Codeigniter 3.x + Smarty - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: External Resources (https://forum.codeigniter.com/forumdisplay.php?fid=7) +--- Forum: Addins (https://forum.codeigniter.com/forumdisplay.php?fid=13) +--- Thread: Codeigniter 3.x + Smarty (/showthread.php?tid=1551) |
Codeigniter 3.x + Smarty - poseso - 03-20-2015 Have anyone had any luck making smarty 3.x + ci 3.x work together? I tried http://www.phpclasses.org/blog/post/261-Working-with-CodeIgniter-HMVC-Framework-Smarty-Template-and-Doctrine-ORM-all-together.html and tried: http://www.coolphptools.com/codeigniter-smarty but both links are for codeigniter 2.x, and i would like to use this template engine. Thanks RE: Codeigniter 3.x + Smarty - aka_ys - 04-02-2015 (03-20-2015, 09:48 AM)poseso Wrote: Have anyone had any luck making smarty 3.x + ci 3.x work together? Hi, i don't tried much, but you need make this. - Download the last smarty compilation http://www.smarty.net/download - Next step path system/libraries create folder Smarty and put inside the smarty compilation - path system/libraries create Smarty.php with this code: Code: <?php - Next, put inside this path application/views/ the folders 'templates' and templates_c - Finally run this in autoload.php (application/config/autoload.php) Code: $autoload['libraries'] = array('smarty'); - And create your controller like this: Code: public function index() - Show data in template: Code: {$title} RE: Codeigniter 3.x + Smarty - isaaciss - 06-18-2015 Hey aka_ys, Thanks for your tip!!! RE: Codeigniter 3.x + Smarty - Jagarm - 09-20-2015 Was there anything else that you did to get this to work? I have followed the instructions but getting Code: An uncaught Exception was encountered The following is my controller for Test PHP Code: <?php Thank you RE: Codeigniter 3.x + Smarty - isaaciss - 10-16-2015 (09-20-2015, 07:02 PM)Jagarm Wrote: Was there anything else that you did to get this to work? I had the same problem but I fixed it downloading Smarty version 3.1.27. Please, try to download it : https://github.com/smarty-php/smarty/archive/v3.1.27.tar.gz RE: Codeigniter 3.x + Smarty - adicin - 01-30-2016 Hi, Use $this->setTemplateDir(APPPATH . "/views/templates/"); instead of $this->template_dir = APPPATH . "/views/templates/"; RE: Codeigniter 3.x + Smarty - abhijeetgk - 05-23-2016 In the above code shared.. it worked fine but when tried to use some advanced concepts like template inheritance http://www.smarty.net/docs/en/advanced.features.template.inheritance.tpl its giving me issue when tried to add "extends" in $this->smarty->view function its just dumping on screen the extends file name provided and nothing else. Let me know if anyone had a success in implementing these concepts RE: Codeigniter 3.x + Smarty - keplerg - 06-21-2016 I updated my code at http://www.coolphptools.com/codeigniter-smarty to work with CodeIgniter 3.0 and Smarty 3.x . Please let me know if you find any issues with the new code. |