CodeIgniter 3 + Smarty 3 - 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 + Smarty 3 (/showthread.php?tid=63782) |
CodeIgniter 3 + Smarty 3 - DarkNight197 - 12-09-2015 Hi, I want to make a website using CodeIgniter 3 and including Smarty 3 (I know how to use them separatly but doesn't works when I use them together). I watched lot of forums but nothing helped me. Could you tell me how to install it correctly and functionnal with the good files as controller and view. Thank you a lot if anyone can give me a quick fix. Cordially RE: CodeIgniter 3 + Smarty 3 - cartalot - 12-09-2015 always look in stackoverflow: http://stackoverflow.com/search?q=codeigniter+smarty RE: CodeIgniter 3 + Smarty 3 - ciadmin - 12-09-2015 There are also some threads in this forum, accessed from our search ... for instance http://forum.codeigniter.com/thread-1551.html?highlight=smarty RE: CodeIgniter 3 + Smarty 3 - kenji - 12-10-2015 Hello smarty 3.1.27 CI 3.0.3 i use this method since CI 2.0 , maybe an update is necessary, but it works fine all smarty files in this folder : application/libraries/smarty/ application/views/templates application/views/templates_c application/libraries/Template.php PHP Code: <?php defined('BASEPATH') OR exit('No direct script access allowed'); an i use like this : PHP Code: $this->load->libraries('template'); //or load in autoload in config/autoload.php if you want use result later : PHP Code: $var = $this->template->appel('var',array('var' => 'Hello world')); application/views/templates/test.tpl Code: This is my test : (-$var-) output : Code: This is my test : Hello world With array PHP Code: $test = array( Template test.tpl PHP Code: (-foreach from=$var key=k item=v name=item-) result PHP Code: a ==> hello RE: CodeIgniter 3 + Smarty 3 - DarkNight197 - 12-23-2015 Thanks all, I tried these tutorials It wokrs but the views files must be in the main folder as index.php I tried to found a solution but it still doesn't work Anyone know why what it's like that ? Thanks RE: CodeIgniter 3 + Smarty 3 - DarkNight197 - 01-04-2016 I found the solution thank a lot for answered ! RE: CodeIgniter 3 + Smarty 3 - Diederik - 01-04-2016 Why not share your solution here? Perhaps it can help someone else in the future. |