CodeIgniter Forums
Smarty in CI - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Smarty in CI (/showthread.php?tid=7759)

Pages: 1 2


Smarty in CI - El Forum - 04-22-2008

[eluser]CodeIgniterNewbie[/eluser]
So, is caching a good enough reason for incorporating Smarty in CI?


Smarty in CI - El Forum - 04-22-2008

[eluser]xwero[/eluser]
It is up to you. If you think some one is going to take over the design somewhere in the future and that person doesn't know how to develop or if you just like the Smarty way of outputting you can add it.


Smarty in CI - El Forum - 04-22-2008

[eluser]CodeIgniterNewbie[/eluser]
Let's just assume all of my designers are also well versed enough in PHP. Is the caching feature enough benefit to invest in Smarty? BTW, what is the "Smarty way of outputting?"


Smarty in CI - El Forum - 04-22-2008

[eluser]xwero[/eluser]
@Sam : that's why i added you can use other libraries like Khaos::KhCache


Smarty in CI - El Forum - 04-22-2008

[eluser]Sam Dark[/eluser]
Well, Khaos::KhCache seems to be really like Smarty's caching.
If your designers are good with php it's better not to use Smarty.


Smarty in CI - El Forum - 04-22-2008

[eluser]xwero[/eluser]
[quote author="CodeIgniterNewbie" date="1208886085"] BTW, what is the "Smarty way of outputting?"[/quote]
If you use Smarty you have to use the methods it provides instead of the CI outputting methods
Code:
// CI
$data['post'] = $formvars;
$data['error'] = $this->error;
$this->load->view('guestbook_form',$data);
// Smarty
$this->smarty->tpl =& new Guestbook_Smarty;
$this->smarty->tpl->assign('post',$formvars);
$this->smarty->tpl->assign('error', $this->error);
$this->smarty->tpl->display('guestbook_form.tpl');
I'm not sure if smarty code is correct but it gives you an idea


Smarty in CI - El Forum - 04-22-2008

[eluser]xwero[/eluser]
@Sam : maybe you can suggest an advanced cache library Wink


Smarty in CI - El Forum - 04-22-2008

[eluser]Sam Dark[/eluser]
The one mentioned previously seems to be good enough.

// I'm using almost the same syntax in my View library.


Smarty in CI - El Forum - 04-22-2008

[eluser]xwero[/eluser]
Here are two more : cache and sparks