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!

Where to buy discount wedding dresses and cheap smart dresses free shipping - Weddingdresstrend.com

Shop for 2018 World Cup Football Boots Online sale at guthjcc.com

Browse best 2018 world cup soccer cleats and shoes from SoccerAzteca.com

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.
Post a Comment
All comments are moderated. Support questions are ignored, use the forums instead.
Author:
Email: (not shown)
What is 4 plus 0? (Are you human?)

Advertisement