Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Fatal error: Uncaught exception 'SmartyException' with messa

 
Post new topic   Reply to topic    Smarty Forum Index -> Installation and Setup
View previous topic :: View next topic  
Author Message
newsmartyfan
Smarty Rookie


Joined: 18 Nov 2012
Posts: 5

PostPosted: Mon Nov 19, 2012 4:13 am    Post subject: Fatal error: Uncaught exception 'SmartyException' with messa Reply with quote

'Unable to parse resource name ""'
in /home/tasker/public_html/smarty/libs/sysplugins/smarty_internal_template.php:941 Stack trace:
#0 /
any help welcome thanks to smarty froom
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 4673
Location: Hamburg / Germany

PostPosted: Mon Nov 19, 2012 9:32 am    Post subject: Reply with quote

It does look like that you did call $smarty->display() without specifing the name of the template. (like $smarty->display('example.tpl') )
Back to top
View user's profile Send private message
newsmartyfan
Smarty Rookie


Joined: 18 Nov 2012
Posts: 5

PostPosted: Mon Nov 19, 2012 6:15 pm    Post subject: Reply with quote

U.Tews wrote:
It does look like that you did call $smarty->display() without specifing the name of the template. (like $smarty->display('example.tpl') )



can you give some guide wher dos is go in which line ? i need insert in my case site dosint show user profile page?('example.tpl') )[/quote] havto be ('user.tpl') )[/quote]

end shows this erorr

Fatal error: Uncaught exception 'SmartyException' with message 'Unable to parse resource name ""' in /home/tasker/public_html/smarty/libs/sysplugins/smarty_internal_template.php:941 Stack trace: #0 /home/tasker/public_html/smarty/libs/sysplugins/smarty_internal_template.php(546): Smarty_Internal_Template->__get('resource_object') #1 /home/tasker/public_html/smarty/libs/Smarty.class.php(338): Smarty_Internal_Template->getRenderedTemplate() #2 /home/tasker/public_html/smarty/libs/Smarty.class.php(382): Smarty->fetch(NULL, NULL, NULL, NULL, true) #3 /home/tasker/public_html/libraries/mysmarty.class.php(92): Smarty->display(NULL) #4 /home/tasker/public_html/user.php(53): STemplate::display(NULL) #5 {main} thrown in /home/tasker/public_html/smarty/libs/sysplugins/smarty_internal_template.php on line 941

?1 >fetch(NULL, NULL, NULL, NULL, true) #3

is it ned to be like this
>fetch(dirL, dir, dir, dirL, true) #3

so its ok to change all NULL s to =DIR



any how Herr is source code
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

* Main class with template data structures and methods
*/
class Smarty_Internal_Template extends Smarty_Internal_Data {
// object cache
public $compiler_object = DIR;
public $cacher_object = DIR;
// Smarty parameter
public $cache_id = DIR;
public $compile_id = DIR;
public $caching = DIR;
public $cache_lifetime = DIR;
public $cacher_class = DIR;
public $caching_type = DIR;
public $forceNocache = false;
// Template resource
public $template_resource = DIR;
public $resource_type = DIR;
public $resource_name = DIR;
// public $resource_object = DIR;
private $isExisting = DIR;
public $templateUid = '';
// Template source
public $template_filepath = DIR;
public $template_source = DIR;
private $template_timestamp = DIR;
// Compiled template
private $compiled_filepath = DIR;
public $compiled_template = DIR;
private $compiled_timestamp = DIR;
public $mustCompile = DIR;
public $suppressHeader = false;
public $suppressFileDependency = false;
public $has_nocache_code = false;
public $write_compiled_code = true;
// Rendered content
public $rendered_content = DIR;
// Cache file
private $cached_filepath = DIR;
public $cached_timestamp = DIR;
private $isCached = DIR;
// private $cache_resource_object = DIR;
private $cacheFileChecked = false;
// template variables
public $tpl_vars = array();
public $parent = DIR;
public $config_vars = array();
// storage for plugin
public $plugin_data = array();
// special properties
public $properties = array ('file_dependency' => array(),
'nocache_hash' => '',
'function' => array());
// required plugins
public $required_plugins = array('compiled' => array(), 'nocache' => array());
public $saved_modifier = DIR;
public $smarty = DIR;
// blocks for template inheritance
public $block_data = array();
public $wrapper = DIR;
/**
* Create template data object
*
* Some of the global Smarty settings copied to template scope
* It load the required template resources and cacher plugins
*
* @param string $template_resource template resource string
* @param object $_parent back pointer to parent object with variables or DIR
* @param mixed $_cache_id cache id or DIR
* @param mixed $_compile_id compile id or DIR
*/
public function __construct($template_resource, $smarty, $_parent = DIR, $_cache_id = DIR, $_compile_id = DIR, $_caching = DIR, $_cache_lifetime = DIR)
{
$this->smarty = &$smarty;
// Smarty parameter
$this->cache_id = $_cache_id === DIR ? $this->smarty->cache_id : $_cache_id;
$this->compile_id = $_compile_id === DIR ? $this->smarty->compile_id : $_compile_id;
$this->caching = $_caching === DIR ? $this->smarty->caching : $_caching;
if ($this->caching === true) $this->caching = Smarty::CACHING_LIFETIME_CURRENT;
$this->cache_lifetime = $_cache_lifetime === DIR ?$this->smarty->cache_lifetime : $_cache_lifetime;
$this->parent = $_parent;
// dummy local smarty variable
$this->tpl_vars['smarty'] = new Smarty_Variable;
// Template resource
$this->template_resource = $template_resource;
// copy block data of template inheritance
if ($this->parent instanceof Smarty_Internal_Template) {
$this->block_data = $this->parent->block_data;
}

}

/**
* Returns the template filepath
*
* The template filepath is determined by the actual resource handler
*
* @return string the template filepath
*/
public function getTemplateFilepath ()
{
return $this->template_filepath === DIR ?
$this->template_filepath = $this->resource_object->getTemplateFilepath($this) :
$this->template_filepath;
}

/**
* Returns the timpestamp of the template source
*
* The template timestamp is determined by the actual resource handler
*
* @return integer the template timestamp
*/
public function getTemplateTimestamp ()
{
return $this->template_timestamp === DIR ?
$this->template_timestamp = $this->resource_object->getTemplateTimestamp($this) :
$this->template_timestamp;
}

/**
* Returns the template source code
*
* The template source is being read by the actual resource handler
*
* @return string the template source
*/
public function getTemplateSource ()
{
if ($this->template_source === DIR) {
if (!$this->resource_object->getTemplateSource($this)) {
throw new SmartyException("Unable to read template {$this->resource_type} '{$this->resource_name}'");
}
}
return $this->template_source;
}

/**
* Returns if the template is existing
*
* The status is determined by the actual resource handler
*
* @return boolean true if the template exists
*/
public function isExisting ($error = false)
{
if ($this->isExisting === DIR) {
$this->isExisting = $this->resource_object->isExisting($this);
}
if (!$this->isExisting && $error) {
throw new SmartyException("Unable to load template {$this->resource_type} '{$this->resource_name}'");
}
return $this->isExisting;
}

/**
* Returns if the current template must be compiled by the Smarty compiler
*
* It does compare the timestamps of template source and the compiled templates and checks the force compile configuration
*
* @return boolean true if the template must be compiled
*/
public function mustCompile ()
{
$this->isExisting(true);
if ($this->mustCompile === DIR) {
$this->mustCompile = ($this->resource_object->usesCompiler && ($this->smarty->force_compile || $this->resource_object->isEvaluated || $this->getCompiledTimestamp () === false ||
// ($this->smarty->compile_check && $this->getCompiledTimestamp () !== $this->getTemplateTimestamp ())));
($this->smarty->compile_check && $this->getCompiledTimestamp () < $this->getTemplateTimestamp ())));
}
return $this->mustCompile;
}

/**
* Returns the compiled template filepath
*
* @return string the template filepath
*/
public function getCompiledFilepath ()
{
return $this->compiled_filepath === DIR ?
($this->compiled_filepath = !$this->resource_object->isEvaluated ? $this->resource_object->getCompiledFilepath($this) : false) :
$this->compiled_filepath;
}

/**
* Returns the timpestamp of the compiled template
*
* @return integer the template timestamp
*/
public function getCompiledTimestamp ()
{
return $this->compiled_timestamp === DIR ?
($this->compiled_timestamp = (!$this->resource_object->isEvaluated && file_exists($this->getCompiledFilepath())) ? filemtime($this->getCompiledFilepath()) : false) :
$this->compiled_timestamp;
}

/**
* Returns the compiled template
*
* It checks if the template must be compiled or just read from the template resource
*
* @return string the compiled template
*/
public function getCompiledTemplate ()
{
if ($this->compiled_template === DIR) {
// see if template needs compiling.
if ($this->mustCompile()) {
$this->compileTemplateSource();
} else {
if ($this->compiled_template === DIR) {
$this->compiled_template = !$this->resource_object->isEvaluated && $this->resource_object->usesCompiler ? file_get_contents($this->getCompiledFilepath()) : false;
}
}
}
return $this->compiled_template;
}

/**
* Compiles the template
*
* If the template is not evaluated the compiled template is saved on disk
*/
public function compileTemplateSource ()
{
if (!$this->resource_object->isEvaluated) {
$this->properties['file_dependency'] = array();
$this->properties['file_dependency'][$this->templateUid] = array($this->getTemplateFilepath(), $this->getTemplateTimestamp(),$this->resource_type);
}
if ($this->smarty->debugging) {
Smarty_Internal_Debug::start_compile($this);
}
// compile template
if (!is_object($this->compiler_object)) {
// load compiler
$this->smarty->loadPlugin($this->resource_object->compiler_class);
$this->compiler_object = new $this->resource_object->compiler_class($this->resource_object->template_lexer_class, $this->resource_object->template_parser_class, $this->smarty);
}
// compile locking
if ($this->smarty->compile_locking && !$this->resource_object->isEvaluated) {
if ($saved_timestamp = $this->getCompiledTimestamp()) {
touch($this->getCompiledFilepath());
}
}
// call compiler
try {
$this->compiler_object->compileTemplate($this);
}
catch (Exception $e) {
// restore old timestamp in case of error
if ($this->smarty->compile_locking && !$this->resource_object->isEvaluated && $saved_timestamp) {
touch($this->getCompiledFilepath(), $saved_timestamp);
}
throw $e;
}




your in put is appreciated ones again thank you


Last edited by newsmartyfan on Sat Nov 24, 2012 2:09 am; edited 1 time in total
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 4673
Location: Hamburg / Germany

PostPosted: Mon Nov 19, 2012 7:46 pm    Post subject: Reply with quote

How does your call of display(...) look like?

It also looks like that you have extended the Smarty class.
Did you overload Smarty's display() method? How does that code look like?
Back to top
View user's profile Send private message
newsmartyfan
Smarty Rookie


Joined: 18 Nov 2012
Posts: 5

PostPosted: Thu Dec 13, 2012 7:10 am    Post subject: Re: Fatal error: Uncaught exception 'SmartyException' with m Reply with quote

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Installation and Setup All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP