add error msgs to get_registered_object

This commit is contained in:
mohrt
2003-02-17 18:03:00 +00:00
parent 9ba5450976
commit 54a0c0e676
3 changed files with 15 additions and 10 deletions

1
NEWS
View File

@@ -1,3 +1,4 @@
- add get_registered_object function (messju, Monte)
- treat unrecognized param attribute syntax as string (Monte) - treat unrecognized param attribute syntax as string (Monte)
- support $smarty.const.$foo syntax (messju, Monte) - support $smarty.const.$foo syntax (messju, Monte)
- remove E_NOTICE warnings from debug.tpl, - remove E_NOTICE warnings from debug.tpl,

View File

@@ -1323,11 +1323,13 @@ class Smarty
* @param string $name * @param string $name
*/ */
function &get_registered_object($name) { function &get_registered_object($name) {
if(isset($this->_reg_objects[$name])) { if (!isset($this->_reg_objects[$object]))
$this->_trigger_fatal_error("'$object' is not a registered object");
if (!is_object($this->_reg_objects[$object][0]))
$this->_trigger_fatal_error("registered '$object' is not an object");
return $this->_reg_objects[$name][0]; return $this->_reg_objects[$name][0];
} else {
return false;
}
} }
/**#@+ /**#@+

View File

@@ -1323,11 +1323,13 @@ class Smarty
* @param string $name * @param string $name
*/ */
function &get_registered_object($name) { function &get_registered_object($name) {
if(isset($this->_reg_objects[$name])) { if (!isset($this->_reg_objects[$object]))
$this->_trigger_fatal_error("'$object' is not a registered object");
if (!is_object($this->_reg_objects[$object][0]))
$this->_trigger_fatal_error("registered '$object' is not an object");
return $this->_reg_objects[$name][0]; return $this->_reg_objects[$name][0];
} else {
return false;
}
} }
/**#@+ /**#@+