Samrty Templation Installtion and Configuration
Posted: Tue Sep 13, 2005 10:14 am
I am having some difficulties getting smarty to work.
1. I'm not certain where to place the smarty folder.
2. I'm not sure where i have to create the templates, templates_c, cahce and configs folders. Or if I need to create them at all.
3. I'm not sure as to what configurations are to be done to the php.config file and php.ini file if any.
I looked at the online installation help files but i am still stuck. For my current setup I have extracted the Smary files into a Smarty folder in htdocs folder.
I created the templates, templates_c, cahce and configs folders in my working directory.
I tried running the follwoing test:
The template file: resides in the template folder
The index.php file: resides in my working folder or application root
I am getting the following errors when i access the index.php file
Warning: _parse_resource_name(C:\htdocs\Smarty\internals\core.get_include_path.php): failed to open stream: No such file or directory in C:\htdocs\Smarty\Smarty.class.php on line 1643
Fatal error: _parse_resource_name(): Failed opening required 'C:\htdocs\Smarty\internals\core.get_include_path.php' (include_path='.;c:\php4\pear') in C:\htdocs\Smarty\Smarty.class.php on line 1643
1. I'm not certain where to place the smarty folder.
2. I'm not sure where i have to create the templates, templates_c, cahce and configs folders. Or if I need to create them at all.
3. I'm not sure as to what configurations are to be done to the php.config file and php.ini file if any.
I looked at the online installation help files but i am still stuck. For my current setup I have extracted the Smary files into a Smarty folder in htdocs folder.
I created the templates, templates_c, cahce and configs folders in my working directory.
I tried running the follwoing test:
The template file: resides in the template folder
Code: Select all
{* Smarty *}
Hello, {$name}!Code: Select all
<?
include('../../Smarty/Smarty.class.php');
// create object
$smarty = new Smarty;
//set the smarty dir
$smarty->template_dir = 'templates/';
$smarty->compile_dir = 'templates_c/';
$smarty->config_dir = 'configs/';
$smarty->cache_dir = 'cache/';
//assign content
$smarty->assign('name','Ned');
//display content
$smarty->display('templates/index.tpl');
?>Warning: _parse_resource_name(C:\htdocs\Smarty\internals\core.get_include_path.php): failed to open stream: No such file or directory in C:\htdocs\Smarty\Smarty.class.php on line 1643
Fatal error: _parse_resource_name(): Failed opening required 'C:\htdocs\Smarty\internals\core.get_include_path.php' (include_path='.;c:\php4\pear') in C:\htdocs\Smarty\Smarty.class.php on line 1643