Michael Gorynia wrote on Sunday 3rd of July 2011:Great job!
Shouldn't there be something like:
'include' => PKGPATH.'parser'.DS.'vendor'.DS.'Smarty'.DS.'Smarty.class.php',
instead of:
'include' => APPPATH.'vendor'.DS.'Smarty'.DS.'libs'.DS.'Smarty.class.php',
in config file?
Paul Boco wrote on Sunday 3rd of July 2011:I've used PHP exclusively in my views since coming to Fuel and I must admit that the code is pretty cluttered. I read somwhere (??) that PHP's native performance is superior to ANY template engine.
Prior to Fuel, I was a big fan of Smarty. Just wondering, is there much of a performance hit with Smarty's use?
public function action_index() { $data['foo'] = 'Success'; $this->response->body = View::factory('welcome/index.tpl', $data); }9) Created file fuel/app/views/welcome/index.tpl with the following contents
<!DOCTYPE html> <html> <head> <title>Smarty Test</title> </head> <body> The value of $foo is [{$foo}] </body> </html>10) Deleted file fuel/app/views/welcome/index.php When I request welcome/index I get the following:
public function action_index() { $data['foo'] = 'Success'; $this->response->body = View::factory('welcome/index.smarty', $data); }
public $extension = 'smarty';rather than:
public $extension = 'tpl';I notice that the assignments in the other files in fuel/packages/parser/classes/view/ correspond with the keys in fuel/packages/parser/config/parser.php. When I do change it to $extension = 'smarty', everything works fine.
'tpl' => array('class' => 'View_Smarty', 'extension' => '.tpl')
Harro Verton wrote on Monday 4th of July 2011:You are right, the default extension should be 'smarty'. I'll see if I can correct that today. edit: done that.
It looks like you're new here. If you want to get involved, click one of these buttons!