Hey!

I have a page with like four tabs, so I want to reuse each tab html
and logic, how to achive this? create a view helper for each tab? I
was looking at the current view helpers code and all of them returns
an string with all the html, it's possible to use a view? a phtml file
to no mix logic with the html? I was thinking something like this:

class Ceiba_View_Helper_News extends Zend_View_Helper_Abstract
{
    protected $_view = null;

    public function setView( Zend_View_Interface $view )
    {
        $this->_view = $view;
    }

    public function news()
    {
        /** some logic **/
        $this->_view->blah = "blah1";

        // I'm adding this path to the bootstrap:
$view->addScriptPath( APPLICATION_PATH . "/views/scripts" );
        return $this->_view->render( "partials/news.phtml" );
    }
}

Any thoughs? thanks.

Reply via email to