CodeIgniter 3 + Smarty 3 |
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
always look in stackoverflow: http://stackoverflow.com/search?q=codeigniter+smarty
There are also some threads in this forum, accessed from our search ... for instance http://forum.codeigniter.com/thread-1551...ght=smarty
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
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
Why not share your solution here? Perhaps it can help someone else in the future.
|
Welcome Guest, Not a member yet? Register Sign In |