aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/smarty/smarty/docs/programmers/api-functions/api-get-registered-object.md
blob: a7c920e1420f0afec5c70c772a56eae5e20da768 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
getRegisteredObject()

returns a reference to a registered object

Description
===========

array

getRegisteredObject

string

object\_name

This is useful from within a custom function when you need direct access
to a [registered object](#api.register.object). See the
[objects](#advanced.features.objects) page for more info.


    <?php
    function smarty_block_foo($params, $smarty)
    {
      if (isset($params['object'])) {
        // get reference to registered object
        $obj_ref = $smarty->getRegisteredObject($params['object']);
        // use $obj_ref is now a reference to the object
      }
    }
    ?>

       

See also [`registerObject()`](#api.register.object),
[`unregisterObject()`](#api.unregister.object) and [objects
page](#advanced.features.objects)