You have a couple of options here.
the easiest way to do what you want would be to use the inlineScript() view helper and add it to the view in the bootstrap or directly in the layout script. The inlneScript() helper works the same way as the headScript() helper but puts the code in the markup. I sometimes use the inlineScript() helper to pass configuration data to audio and video players.
Alternatively you can build your own placeholder using your view helper and just initialize it in the bootstrap.
http://framework.zend.com/manual/en/zend.view.helpers.html#zend.view.helpers. initial.placeholder” rel=“nofollow”>placeholder 。 因此:
诱杀装置:
protected function _initMenus() {
//get view object
$view = $this->getResource( view );
//assign the id for the menus...
$view->mainMenuId = 4;
$view->adminMenuId = 5;
}
编造:
<?php
$this->layout()->adminMenu = $this->action(
render , menu , null, array( menu => $this->adminMenuId))
?>
<div id="adminMenu">
<!-- Render the placeholder -->
<?php echo $this->layout()->adminMenu ?>
</div>
这名持有人只是使用 helper to calls a makeAction(......),但你与土地持有人做些什么却受到你的想象力的限制。