Welcome Guest, Not a member yet? Register   Sign In
Smarty Integration problem
#1

[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.
#2

[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.
#3

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

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




Theme © iAndrew 2016 - Forum software by © MyBB