kingot
01-24-2012, 01:33 PM
Hi ,
I am setting up a smarty template but it giving me an errors
Here is the error but mean while i have write the dir correct
Here is the error
( ! ) Warning: require(smarty_connect.php) [function.require]: failed to open stream: No such file or directory in C:\wamp\www\index.php on line 3
Call Stack
# Time Memory Function Location
1 0.0025 364824 {main}( ) ..\index.php:0
( ! ) Fatal error: require() [function.require]: Failed opening required 'smarty_connect.php' (include_path='.;C:\php\pear') in C:\wamp\www\index.php on line 3
Call Stack
# Time Memory Function Location
1 0.0025 364824 {main}( )
And the pages are : index.php which is inside my main www dir
<?php
//starting index.php
require('smarty_connect.php');
$smarty= new smarty_connect.php;
$smarty->assign('name','Clement');
$smarty->display('index.tpl');
?>
And smarty_connect.php page which is outside the www root dir ..so i created a folder called smarty in disc c; and inside the smarty folder is where my demo, libs, template_c, cache folders are
here the code for smarty_connect.php
//smarting smarty connect
//first loading smarty libraries
require('smarty.class.php');
class smarty_connect extends smarty{
function smarty_connect(){
$smarty= new smarty;
$this->smarty();
$this->template_dir='C:\wamp\www\Smarty\templates';
$this->config_dir='C:\wamp\www\Smarty\config';
$this->compile_dir='C:\Smarty\templates_c';
$this->cache_dir='C:\Smarty\cache';
}
}
?>
And finally index.tpl page which is inside 'C:\Smarty\templates_c' means inside template_c
here is the code
<html>
<body>
Hello,{$name}
</body>
</html>
Please help,
Thanks
I am setting up a smarty template but it giving me an errors
Here is the error but mean while i have write the dir correct
Here is the error
( ! ) Warning: require(smarty_connect.php) [function.require]: failed to open stream: No such file or directory in C:\wamp\www\index.php on line 3
Call Stack
# Time Memory Function Location
1 0.0025 364824 {main}( ) ..\index.php:0
( ! ) Fatal error: require() [function.require]: Failed opening required 'smarty_connect.php' (include_path='.;C:\php\pear') in C:\wamp\www\index.php on line 3
Call Stack
# Time Memory Function Location
1 0.0025 364824 {main}( )
And the pages are : index.php which is inside my main www dir
<?php
//starting index.php
require('smarty_connect.php');
$smarty= new smarty_connect.php;
$smarty->assign('name','Clement');
$smarty->display('index.tpl');
?>
And smarty_connect.php page which is outside the www root dir ..so i created a folder called smarty in disc c; and inside the smarty folder is where my demo, libs, template_c, cache folders are
here the code for smarty_connect.php
//smarting smarty connect
//first loading smarty libraries
require('smarty.class.php');
class smarty_connect extends smarty{
function smarty_connect(){
$smarty= new smarty;
$this->smarty();
$this->template_dir='C:\wamp\www\Smarty\templates';
$this->config_dir='C:\wamp\www\Smarty\config';
$this->compile_dir='C:\Smarty\templates_c';
$this->cache_dir='C:\Smarty\cache';
}
}
?>
And finally index.tpl page which is inside 'C:\Smarty\templates_c' means inside template_c
here is the code
<html>
<body>
Hello,{$name}
</body>
</html>
Please help,
Thanks