I have a 'dashboard' area in an application that I'm building that
essentially displays various logos based on certain criteria; new messages,
alerts, etc.

Here's an example of what I have so far...

class AdminController extends Zend_Controller_Action
{
       function init()
        {
                $registry       = Zend_Registry::getInstance();
                $db                     = $registry['db'];
                
        // Render navigation and dashboard
        $response = $this->getResponse();
        $response->insert('navigation',
$this->view->render('admin/menu.phtml'))
                                ->insert('dashboard',
$this->view->render('admin/dashboard.phtml'));
      
        $new_requests = $db->fetchAll("SELECT count(RID) FROM Alerts WHERE
alert_status = 'N'");
      
        if ( sizeof($new_requests) > 0 ) {
                //Pass view variable to 'admin/dashboard.phtml'
        }
        
        }
}

I can't figure out how to pass the variable to the dashboard.phtml file and
display it... I'm still a ZF newbie, but I think it needs to happen before
the post_dispatch action and be rendered for every page. Does this require
me to build a custom helper??

Any help would be appreciated!!
-- 
View this message in context: 
http://www.nabble.com/Passing-View-Variables-in-Controller%27s-init%28%29-tp18781276p18781276.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to