View Helper, Partial View or Something Else

◇◆丶佛笑我妖孽 提交于 2019-12-06 03:23:34

You might want to consider using partials: http://framework.zend.com/manual/en/zend.view.helpers.html#zend.view.helpers.initial.partial

For example, you could have an admin-locations.phtml partial that contains:

<div id='admin-locations' class='panel'>
    <header class="panel-header">
        <h2>Locations</h2>
    </header>
    <div class='panel-content'>
        <div id='locations-table' class="google_vis_table"></div>
        <?php echo $this->form; ?>
    </div>
</div>

Now you can simply repeatedly call the partial within a view, with or without supplying a form:

...
echo $this->partial('admin-locations.phtml');
echo $this->partial('admin-locations.phtml', array('form' => $this->yourForm);
echo $this->partial('admin-locations.phtml');
...

Hope this helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!