|
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 |
dmllc Smarty Rookie
Joined: 15 Oct 2010 Posts: 6
|
Posted: Fri Oct 15, 2010 7:58 pm Post subject: cant figure out why tempalte wont load |
|
|
im a smarty noob. this is the first site ive developed using smarty so be easy.
ive installed smarty on my web server and can create a new smarty object. however when i try to render a template i get the following error:
<b>Fatal error</b>: Uncaught exception 'SmartyException' with message 'Unable to load template file 'index.tpl'' in /lib/Smarty-3.0rc4/libs/sysplugins/smarty_internal_template.php:174
Stack trace:
#0 /lib/Smarty-3.0rc4/libs/sysplugins/smarty_internal_template.php(551): Smarty_Internal_Template->isExisting(true)
#1 /lib/Smarty-3.0rc4/libs/Smarty.class.php(328): Smarty_Internal_Template->getRenderedTemplate()
#2 /lib/Smarty-3.0rc4/libs/Smarty.class.php(370): Smarty->fetch('index.tpl', NULL, NULL, NULL, true)
#3 /sites/clients/DigitalMedia/digitalmedia-llc_net/v3_0/httpfiles/index.php(21): Smarty->display('index.tpl')
#4 {main}
thrown in <b>/lib/Smarty-3.0rc4/libs/sysplugins/smarty_internal_template.php</b> on line <b>174</b>
this is where it's erroring:
public function isExisting ($error = false)
169 {
170 if ($this->isExisting === null) {
171 $this->isExisting = $this->resource_object->isExisting($this);
172 }
173 if (!$this->isExisting && $error) {
174 throw new SmartyException("Unable to load template {$this->resource_type} '{$this->resource_name}'");
175 }
176 return $this->isExisting;
177 }
i'm not sure how to resolve this error. here is my source code:
require_once("../php/global/constants.php");
require_once(SMARTY_DIR . "Smarty.class.php");
$smarty = new Smarty();
$smarty->template_dir = "/htdocs/clients/DigitalMedia/v3_0/templates/";
$smarty->compile_dir = "/htdocs/clients/DigitalMedia/v3_0/templates_c/";
$smarty->config_dir = "/htdocs/clients/DigitalMedia/v3_0/configs/";
$smarty->cache_dir = "/htdocs/clients/DigitalMedia/v3_0/cache/";
$smarty->debugging = true;
$smarty->assign("tagTitle",SITE_NAME);
$smarty->display('index.tpl'); |
|
Back to top |
|
highryse Smarty Rookie
Joined: 16 Dec 2010 Posts: 25
|
Posted: Thu Dec 16, 2010 11:39 am Post subject: |
|
|
hey there - sorry I can't help but basically I have the same problem - did you ever resolve it? |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Thu Dec 16, 2010 3:07 pm Post subject: |
|
|
Does this directory exist?
/htdocs/clients/DigitalMedia/v3_0/templates/
Does this file exists, and readable by PHP?
/htdocs/clients/DigitalMedia/v3_0/templates/index.tpl
check those first. |
|
Back to top |
|
bigking Smarty n00b
Joined: 16 Jun 2012 Posts: 1
|
Posted: Sun Jun 17, 2012 6:33 am Post subject: |
|
|
I'm having the same problem how to fix it? |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sun Jun 17, 2012 8:21 am Post subject: |
|
|
Insert $smarty->testInstall(); in your script after you have configured the folders.
It will produce some output if the folders are accessable. |
|
Back to top |
|
sasajib Smarty n00b
Joined: 01 Oct 2012 Posts: 1
|
Posted: Mon Oct 01, 2012 6:22 pm Post subject: |
|
|
test your smarty installation
$smarty->testInstall();exit;
if template/other directory not found you can use " SMARTY_DIR " constant for full path |
|
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
|