[Phpwm] Zend Framework - FlashMessenger

Elliot Smith elliot at townx.org
Mon Jul 16 15:15:31 BST 2007


Thanks Peter. However, it turns out I was using it right all along, but 
that FlashMessenger has a bug in PHP 5.2.0:

http://framework.zend.com/issues/browse/ZF-1385

When I applied the patch included with the issue on the bug tracker, 
everything worked fine. Grrr! I figured it out by turning on all the 
notice errors and seeing a bizarre error about overloading:

*Notice*: Indirect modification of overloaded property 
Zend_Session_Namespace::$default has no effect in 
*/home/ell/dev/php/sleet/lib/zendframework/library/Zend/Controller/Action/Helper/FlashMessenger.php* 
on line *134*

Which turned up the bug when I googled. Annoying.

Elliot




Peter Measham wrote:
> I use flash messenger like this:
>
> <?php
>
> class IndexController extends Zend_Controller_Action {
>
>         public function init() {
>             $this->_flashMessenger = 
> $this->_helper->getHelper('FlashMessenger');
>             $this->view->messages = 
> $this->_flashMessenger->getMessages();
>         }
>
>         public function indexAction() {
>
>         }
>
>         public function sectionAction() {
>                 $this->_flashMessenger->addMessage('Invalid Section');
>                 $this->_redirect('/');
>         }
>
> }
>
> ?>
>
> Then in the header template:
>
> <?php echo (isset($messages[0]))? $messages[0]: ""; ?>
>
> Peter
>
> _______________________________________________
> Phpwm mailing list
> Phpwm at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/phpwm




More information about the Phpwm mailing list