/** * * Resets $this->_view_object to use the Layout templates. * * This effectively re-uses the Solar_View object from the page * (with its helper objects and data) to build the layout. This * helps to transfer JavaScript and other layout data back up to * the layout with zero effort. * * Automatically sets up a template-path stack for you, searching * for layout files (e.g.) in this order ... * * 1. Vendor/App/Example/Layout/ * * 2. Vendor/Controller/Page/Layout/ * * 3. Solar/Controller/Page/Layout/ * * @return void * */ protected function _setLayoutTemplates() { // get the parents of the current class, including self $stack = array_reverse(Solar_Class::parents($this, true)); // remove Solar_Base array_pop($stack); // convert underscores to slashes, and add /Layout foreach ($stack as $key => $val) { $stack[$key] = str_replace('_', '/', $val) . '/Layout'; } // done, add the stack $this->_view_object->setTemplatePath($stack); }