1: | <?php
|
2: |
|
3: | |
4: | |
5: | |
6: | |
7: | |
8: | |
9: | |
10: | |
11: |
|
12: | class Smarty_Internal_Method_GetRegisteredObject
|
13: | {
|
14: | |
15: | |
16: | |
17: | |
18: |
|
19: | public $objMap = 3;
|
20: |
|
21: | |
22: | |
23: | |
24: | |
25: | |
26: | |
27: | |
28: | |
29: | |
30: | |
31: | |
32: |
|
33: | public function getRegisteredObject(Smarty_Internal_TemplateBase $obj, $object_name)
|
34: | {
|
35: | $smarty = $obj->_getSmartyObj();
|
36: | if (!isset($smarty->registered_objects[ $object_name ])) {
|
37: | throw new SmartyException("'$object_name' is not a registered object");
|
38: | }
|
39: | if (!is_object($smarty->registered_objects[ $object_name ][ 0 ])) {
|
40: | throw new SmartyException("registered '$object_name' is not an object");
|
41: | }
|
42: | return $smarty->registered_objects[ $object_name ][ 0 ];
|
43: | }
|
44: | }
|
45: | |