Are you sure that block of code is running? Keep in mind that isset() returns false if the variable *is* set but is set to null.
Also, you might be better off injecting some HTML into a placeholder. The FlashMessenger could also be used, but when you pull messages from it you need to check both the messages and the "current" messages (otherwise you'll need to wait for the next request to see the message). -- Hector On Fri, Apr 16, 2010 at 9:00 AM, Aurimas Likas <[email protected]> wrote: > Hey, > > Im trying to do smth like that: if user has not confirmed his account - > show him a notice message in every website page, so i tried to write front > controller plugin for that (the goal is to prepend layout()->content with > that message: > > public function dispatchLoopShutdown() > { > if (Zend_Auth::getInstance()->hasIdentity() > && Zend_Registry::isRegistered('Session_Default') > ) { > > $sess = Zend_Registry::get('Session_Default'); > if (isset($sess->user->confirmed) && !$sess->user->confirmed) { > > $layout = > Zend_Controller_Action_HelperBroker::getStaticHelper('layout') > $msgContent = 'YOU DID NOT CONFIRMED '; > > $contentKey = $layout->getContentKey(); > $layout->assign($contentKey, $msgContent . > $layout->$contentKey); > > // here everything is OK > // echo $layout->$contentKey > } > } > } > > So if I echo the content in plugin - it is what it should be but in website > there are NO message appended :// > What I am missing here? > > > >
