|
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 |
Lincoln Smarty n00b
Joined: 09 May 2011 Posts: 3
|
Posted: Mon May 09, 2011 12:22 am Post subject: [Help]-Install smarty |
|
|
Hello, I'm Lincoln . I have problem ,I can not install Smarty 3.0.7 .
It is this error:
Code: | Fatal error: Uncaught exception 'SmartyException' with message 'Unable to load template file 'index.tpl'' in D:\xampp\htdocs\Smarty-3.0.7\libs\sysplugins\smarty_internal_template.php:163 Stack trace: #0 D:\xampp\htdocs\Smarty-3.0.7\libs\sysplugins\smarty_internal_template.php(550): Smarty_Internal_Template->isExisting(true) #1 D:\xampp\htdocs\Smarty-3.0.7\libs\Smarty.class.php(338): Smarty_Internal_Template->getRenderedTemplate() #2 D:\xampp\htdocs\Smarty-3.0.7\libs\Smarty.class.php(382): Smarty->fetch('index.tpl', NULL, NULL, NULL, true) #3 D:\xampp\htdocs\Smarty-3.0.7\demo\index.php(31): Smarty->display('index.tpl') #4 {main} thrown in D:\xampp\htdocs\Smarty-3.0.7\libs\sysplugins\smarty_internal_template.php on line 163 |
And this is my code:
Code: | <?php
define('SMARTY_DIR', 'D:/xampp/htdocs/Smarty-3.0.7/libs/');
require SMARTY_DIR.'Smarty.class.php';
$smarty = new Smarty;
$smarty->setTemplateDir('../Smarty-3.0.7/demo/templates');
$smarty->setCompileDir('../Smarty-3.0.7/demo/templates_c');
$smarty->setCacheDir('/../Smarty-3.0.7/demo/cache');
$smarty->setConfigDir('../Smarty-3.0.7/demo/configs');
//$smarty->force_compile = true;
$smarty->debugging = true;
$smarty->caching = true;
$smarty->cache_lifetime = 120;
$smarty->assign("Name","Fred Irving Johnathan Bradley Peppergill",true);
$smarty->assign("FirstName",array("John","Mary","James","Henry"));
$smarty->assign("LastName",array("Doe","Smith","Johnson","Case"));
$smarty->assign("Class",array(array("A","B","C","D"), array("E", "F", "G", "H"),
array("I", "J", "K", "L"), array("M", "N", "O", "P")));
$smarty->assign("contacts", array(array("phone" => "1", "fax" => "2", "cell" => "3"),
array("phone" => "555-4444", "fax" => "555-3333", "cell" => "760-1234")));
$smarty->assign("option_values", array("NY","NE","KS","IA","OK","TX"));
$smarty->assign("option_output", array("New York","Nebraska","Kansas","Iowa","Oklahoma","Texas"));
$smarty->assign("option_selected", "NE");
$smarty->display('index.tpl');
?>
|
Please help me !!! |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Mon May 09, 2011 3:21 am Post subject: |
|
|
run $smarty->testInstall(). You probably have your paths wrong. Use absolute system paths for the template_dir, compile_dir, etc. |
|
Back to top |
|
Lincoln Smarty n00b
Joined: 09 May 2011 Posts: 3
|
Posted: Mon May 09, 2011 12:07 pm Post subject: |
|
|
Thank , but i have next problem .
Quote: | Smarty Installation test...
Testing template directory...
.\templates\ is OK.
Testing compile directory...
.\templates_c\ is OK.
Testing plugins directory...
D:/xampp/htdocs/Smarty-3.0.7/libs/plugins\ is OK.
Testing cache directory...
.\cache\ is OK.
Testing configs directory...
.\configs\ is OK.
Tests complete.
Fatal error: Uncaught exception 'SmartyException' with message 'Unable to load template file 'index.tpl'' in D:\xampp\htdocs\Smarty-3.0.7\libs\sysplugins\smarty_internal_template.php:163 Stack trace: #0 D:\xampp\htdocs\Smarty-3.0.7\libs\sysplugins\smarty_internal_template.php(550): Smarty_Internal_Template->isExisting(true) #1 D:\xampp\htdocs\Smarty-3.0.7\libs\Smarty.class.php(338): Smarty_Internal_Template->getRenderedTemplate() #2 D:\xampp\htdocs\Smarty-3.0.7\libs\Smarty.class.php(382): Smarty->fetch('index.tpl', NULL, NULL, NULL, true) #3 D:\xampp\htdocs\Smarty-3.0.7\demo\index.php(32): Smarty->display('index.tpl') #4 {main} thrown in D:\xampp\htdocs\Smarty-3.0.7\libs\sysplugins\smarty_internal_template.php on line 163 |
My code :
Code: | <?php
define('SMARTY_DIR', 'D:/xampp/htdocs/Smarty-3.0.7/libs/');
require SMARTY_DIR.'Smarty.class.php';
$smarty = new Smarty;
$smarty->testInstall();
$smarty->setTemplateDir('http://localhost/Smarty-3.0.7/demo/templates');
$smarty->setCompileDir('http://localhost/Smarty-3.0.7/demo/templates_c');
$smarty->setCacheDir('http://localhost/Smarty-3.0.7/demo/cache');
$smarty->setConfigDir('http://localhost/Smarty-3.0.7/demo/configs');
//$smarty->force_compile = true;
$smarty->debugging = true;
$smarty->caching = true;
$smarty->cache_lifetime = 120;
$smarty->assign("Name","Fred Irving Johnathan Bradley Peppergill",true);
$smarty->assign("FirstName",array("John","Mary","James","Henry"));
$smarty->assign("LastName",array("Doe","Smith","Johnson","Case"));
$smarty->assign("Class",array(array("A","B","C","D"), array("E", "F", "G", "H"),
array("I", "J", "K", "L"), array("M", "N", "O", "P")));
$smarty->assign("contacts", array(array("phone" => "1", "fax" => "2", "cell" => "3"),
array("phone" => "555-4444", "fax" => "555-3333", "cell" => "760-1234")));
$smarty->assign("option_values", array("NY","NE","KS","IA","OK","TX"));
$smarty->assign("option_output", array("New York","Nebraska","Kansas","Iowa","Oklahoma","Texas"));
$smarty->assign("option_selected", "NE");
$smarty->display('index.tpl');
?>
|
|
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Mon May 09, 2011 2:53 pm Post subject: |
|
|
Quote: | $smarty->setTemplateDir('http://localhost/Smarty-3.0.7/demo/templates');
$smarty->setCompileDir('http://localhost/Smarty-3.0.7/demo/templates_c');
$smarty->setCacheDir('http://localhost/Smarty-3.0.7/demo/cache');
$smarty->setConfigDir('http://localhost/Smarty-3.0.7/demo/configs'); |
that will not work, these need to be system filepaths. |
|
Back to top |
|
Lincoln Smarty n00b
Joined: 09 May 2011 Posts: 3
|
Posted: Tue May 10, 2011 3:09 am Post subject: |
|
|
Thank!
OMG , I have new problem .
Quote: | Smarty Installation test...
Testing template directory...
.\templates\ is OK.
Testing compile directory...
.\templates_c\ is OK.
Testing plugins directory...
D:/xampp/htdocs/Smarty-3.0.7/libs/plugins\ is OK.
Testing cache directory...
.\cache\ is OK.
Testing configs directory...
.\configs\ is OK.
Tests complete.
/*%%SmartyNocache:239834dc8acba7b18d2-52092676%%*//*/%%SmartyNocache:239834dc8acba7b18d2-52092676%%*/
Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "D:\xampp\htdocs/Smarty-3.0.7/demo/templates\header.tpl" on line 3 "{popup_init src="/javascripts/overlib.js"}" unknown tag "popup_init"' in D:\xampp\htdocs\Smarty-3.0.7\libs\sysplugins\smarty_internal_templatecompilerbase.php:431 Stack trace: #0 D:\xampp\htdocs\Smarty-3.0.7\libs\sysplugins\smarty_internal_templatecompilerbase.php(253): Smarty_Internal_TemplateCompilerBase->trigger_template_error('unknown tag "po...', 3) #1 D:\xampp\htdocs\Smarty-3.0.7\libs\sysplugins\smarty_internal_templateparser.php(2319): Smarty_Internal_TemplateCompilerBase->compileTag('popup_init', Array) #2 D:\xampp\htdocs\Smarty-3.0.7\libs\sysplugins\smarty_internal_templateparser.php(2812): Smarty_Internal_Templateparser->yy_r35() #3 D:\xampp\htdocs\Smarty-3.0.7\libs\sysplugins\smarty_internal_templateparser.php(2912): Smarty_Internal_Templateparser->yy_reduce(35) #4 D:\xampp\htdocs\Smarty-3.0.7\libs\sysplugins\smarty_internal_smartytemplat in D:\xampp\htdocs\Smarty-3.0.7\libs\sysplugins\smarty_internal_templatecompilerbase.php on line 431 |
My code:
Code: | <?php
define('SMARTY_DIR', 'D:/xampp/htdocs/Smarty-3.0.7/libs/');
require SMARTY_DIR.'\Smarty.class.php';
$smarty = new Smarty;
$smarty->testInstall();
$smarty->setTemplateDir('D:\xampp\htdocs/Smarty-3.0.7/demo/templates');
$smarty->setCompileDir('D:\xampp\htdocs/Smarty-3.0.7/demo/templates_c');
$smarty->setCacheDir('D:\xampp\htdocs/Smarty-3.0.7/demo/cache');
$smarty->setConfigDir('D:\xampp\htdocs/Smarty-3.0.7/demo/configs');
//$smarty->force_compile = true;
$smarty->debugging = true;
$smarty->caching = true;
$smarty->cache_lifetime = 120;
$smarty->assign("Name","Fred Irving Johnathan Bradley Peppergill",true);
$smarty->assign("FirstName",array("John","Mary","James","Henry"));
$smarty->assign("LastName",array("Doe","Smith","Johnson","Case"));
$smarty->assign("Class",array(array("A","B","C","D"), array("E", "F", "G", "H"),
array("I", "J", "K", "L"), array("M", "N", "O", "P")));
$smarty->assign("contacts", array(array("phone" => "1", "fax" => "2", "cell" => "3"),
array("phone" => "555-4444", "fax" => "555-3333", "cell" => "760-1234")));
$smarty->assign("option_values", array("NY","NE","KS","IA","OK","TX"));
$smarty->assign("option_output", array("New York","Nebraska","Kansas","Iowa","Oklahoma","Texas"));
$smarty->assign("option_selected", "NE");
$smarty->display('index.tpl');
?>
|
|
|
Back to top |
|
Aristophan Smarty Regular
Joined: 10 Jan 2011 Posts: 96
|
Posted: Tue May 31, 2011 4:19 pm Post subject: |
|
|
Shouldn't this be another hint to finally get rid of the {popup_init src="/javascripts/overlib.js"} in the demos header.tpl?
It even ships with latest Smarty 3 release...
|
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Tue May 31, 2011 8:41 pm Post subject: |
|
|
popup_init was removed in the trunk, it will be reflected in the next release.
13/02/2011
- bugfix replace $smarty->triggerError() by exception in smarty_internal_resource_extends.php
- removed obsolete {popup_init..} plugin from demo templates |
|
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
|
|