CodeIgniter Forums
Smarty Integration problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Smarty Integration problem (/showthread.php?tid=4055)



Smarty Integration problem - El Forum - 11-05-2007

[eluser]Unknown[/eluser]
Hi,

I am trying to integrate smarty in CI.

1] I made one smarty.php page in application/libraries folder which is including Smarty.class file
<?php require_once(APPPATH . 'libraries/smarty/Smarty.class.php'); ?>
2] I made one function in class blog blog.php file inside controller folder
function test_Smarty()
{
$this->load->library('smarty');
$this->smarty->template_dir = APPPATH . 'smarty/templates/';
$this->smarty->compile_dir = APPPATH . 'smarty/templates_c/';
$this->smarty->cache_dir = APPPATH . 'smarty/cache/';
$this->smarty->config_dir = APPPATH . 'smarty/configs/';

$this->smarty->assign('name', 'Ned');
$this->smarty->display('index.tpl');
}
3] I have made index.tpl and kept in templates folder. I'm trying to run the file. It giving error.
A PHP Error was encountered
Severity: User Warning
Message: Smarty error: unable to read resource: "index.tpl"
Filename: smarty/Smarty.class.php
Line Number: 1095


Can anybody help me out.

Thanks,
vasu.


Smarty Integration problem - El Forum - 11-05-2007

[eluser]sophistry[/eluser]
it looks like a path problme. do you have an APPPATH/smarty dir? or is smarty dir actually in libraries?

search forums on mohrt - the username of one of the msarty maintainers who also happens to use CI.

he posted some stuff about smarty, maybe a year ago. searching on his username and/or on smarty should find you some info.


Smarty Integration problem - El Forum - 11-05-2007

[eluser]esra[/eluser]
http://ellislab.com/forums/viewthread/44719/


Smarty Integration problem - El Forum - 11-05-2007

[eluser]Unknown[/eluser]
Thank you..Smarty is working in CI.Thanks for quick reply GR8