|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
telim Smarty n00b
Joined: 06 Sep 2013 Posts: 1
|
Posted: Wed Sep 11, 2013 6:29 am Post subject: fatal error unable to load template file index. Php |
|
|
I am a complete novice with smarty and have being trying for about six days on how to solve smarty template error problem without luck. Had like some one to put me through on how to go about these error. Your advice will be highly appreciated.
These are my folder structur
gcproject
-smarty
--libs
-templates
--index.tpl
-templates_c
-cache
-config
-index.php
-testinstall.php
when i load testinstall.php it shows all folders are okay.
code in index.php
<?php
require_once('Smarty.class.php');
$smarty= new Smarty();
$smarty->template_dir='c:/wamp/www/gcproject/templates'
$smarty->compile_dir='c:/wamp/www/gcproject/templates_c'
$smarty->cache_dir='c:/wamp/www/gcproject/cache'
$smarty->config_dir='c:/wamp/www/gcproject/config'
$ s ma r t y - > assign( 'name ' , ' maingate' ) ;
$ smarty- > display ( 'index.tpl ' ) ;
?>
code in index.tpl
{* Smarty *}
Hello {$name}, welcome to Smarty!
when i load testinstall.php page it shows all folders are oka but each time i load index.php i get the following error.
<?php ini_set('display_errors', 0); error_reporting(E_ALL); require(dirname(__FILE__) . '../ includes_index.php'); $old_error_handler = set_error_ handler(array('Controller', 'handleError'), E_ALL); $controller = new Controller(); $controller->processRequest(); $controller->displayOutput(); ?> Fatal error: Uncaught exception 'SmartyException' with message 'Unable to load template file 'index.tpl'' in c:/wamp/www/gcproject/Smarty/libs/sysplugins/ smarty_internal_ templatebase.php:127 Stack trace: #0 c:/wamp/www/gcproject/Smarty/ libs/sysplugins/smarty_internal_ templatebase.php(374): Smarty_ Internal_TemplateBase->fetch ('index.tpl', NULL, NULL, NULL, true) #1 c:/wamp/www/gcproject/ index.php(336): Smarty_Internal_TemplateBase- >display('index.tpl') c:/wamp/ www/gcproject/index.php (14): Controller->displayOutput() #3 {main} thrown in c:/wamp/www//Smarty/libs/sysplugins/ smarty_internal_templatebase.php on line 127 |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|