Get Smarty

Donate

Smarty Icon

You may use the Smarty logo according to the trademark notice.

Smarty Template Engine Smarty Template Engine

For sponsorship, advertising, news or other inquiries, contact us at:

Sites Using Smarty

Buy cheap glasses from Cheapglasses123.com and save up to 80%.

Where to buy prescription glasses? EyewearCanada.com is your best choice!

Visit www.sport-kick.com for cheap soccer cleats, sneakers and Soccer Jerseys updates

Advertisement

Name

getRegisteredObject() — 获取已注册对象

说明

array getRegisteredObject(string object_name);

该函数可以很方便地在自定义函数中获取一个注册对象。详情参见 对象

Example 14.28. getRegisteredObject()


<?php
function smarty_block_foo($params, $smarty)
{
  if (isset($params['object'])) {
    // 获取已注册对象
    $obj_ref = $smarty->getRegisteredObject($params['object']);
    // 现在可通过 $obj_ref 来操作对象
  }
}
?>

   

参见 registerObject(), unregisterObject()对象

Comments
No comments for this page.

Advertisement