mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 10:24:26 +02:00
add error msgs to get_registered_object
This commit is contained in:
1
NEWS
1
NEWS
@@ -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,
|
||||||
|
@@ -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]))
|
||||||
return $this->_reg_objects[$name][0];
|
$this->_trigger_fatal_error("'$object' is not a registered object");
|
||||||
} else {
|
|
||||||
return false;
|
if (!is_object($this->_reg_objects[$object][0]))
|
||||||
}
|
$this->_trigger_fatal_error("registered '$object' is not an object");
|
||||||
|
|
||||||
|
return $this->_reg_objects[$name][0];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**#@+
|
/**#@+
|
||||||
|
@@ -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]))
|
||||||
return $this->_reg_objects[$name][0];
|
$this->_trigger_fatal_error("'$object' is not a registered object");
|
||||||
} else {
|
|
||||||
return false;
|
if (!is_object($this->_reg_objects[$object][0]))
|
||||||
}
|
$this->_trigger_fatal_error("registered '$object' is not an object");
|
||||||
|
|
||||||
|
return $this->_reg_objects[$name][0];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**#@+
|
/**#@+
|
||||||
|
Reference in New Issue
Block a user