hi again,

I extended Zend_View_Helper_Action to my own helper as follows:

class MyApp_View_Helper_Block extends Zend_View_Helper_Action
{
    public function block($action, $controller, $module = null, array
$params = array(), $title = null, $layout = "block.phtml")
    {
        $view = new Zend_View();

        $paths = $this->view->getScriptPaths();

        foreach ($paths as $path)
        {
                $view->addScriptPath($path);
        }

        if ($title != null)
        {
                $view->title = $title;
        }

        $view->content = parent::action($action, $controller, $module,
$params);

        return $view->render($layout);
    }
}

and my block.phtml example:

<div class="block">

        <?php if ($this->title != null): ?>
        <div class="block-title"><h2><?= $this->title ?></h2></div>
        <?php endif; ?>

        <div class="block-content"><?= $this->content ?></div>

</div>


br, Marko
-- 
View this message in context: 
http://www.nabble.com/Action-helper-and-Layout-tp20138119p20144664.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to