ZF-7062: Zend_Application_Resource_Layout: support for custom Layout Classes (My_Layout)

Issue Type: Improvement Created: 2009-06-21T00:31:52.000+0000 Last Updated: 2009-06-21T05:09:41.000+0000 Status: Resolved Fix version(s): Reporter: Marco Frank (melchior) Assignee: Dolf Schimmel (Freeaqingme) (freak) Tags: - Zend_Application

Related issues: Attachments:



it would be nice to get support for custom Layout classes like My_Layout by the layout resource plugin.

currently I workaround this by using the _init() functions in Bootstrap to get the layout initialized:

protected function _initLayout () { $view = $this->getResource('View');

    $options = array(
        'view'     => $view,
        'layout'     => 'layout_standard',
        'layoutPath' => APPLICATION_PATH . '/layouts/scripts/',
        'contentKey' => 'content',           // ignored when MVC not used
        'viewSuffix' => 'html',

    $layout = Herod_Layout::getMvcInstance();
    return $layout;

thx and greetings! marco


Posted by Ben Rexin (salz) on 2009-06-21T05:09:25.000+0000

That not an bug, create your own Resource Plugin!


<pre class="highlight">
class App_Application_Resource_Layout extends Zend_Application_Resource_Layout {
    public function getLayout()
        if (null === $this->_layout) {
            $this->_layout = Herod_Layout::startMvc($this->getOptions());
        return $this->_layout;

and for the applications.ini: /application/configs/application.ini

<pre class="highlight">

Posted by Dolf Schimmel (Freeaqingme) (freak) on 2009-06-21T05:09:41.000+0000

This is not an issue. The resource plugins that are shipped with ZF are meant for ZF components only. If you need a resource plugin for another component you can simply extend Zend_Application_Resource_Layout or Zend_Application_Resource_ResourceAbstract.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.