codegooglecom / rend

Automatically exported from code.google.com/p/rend
Other
0 stars 0 forks source link

No default support for the FlashMessenger helper #7

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Not 100% sure if this is inside the scope of Rend... but suggested default:

In Rend_Controller_Action's preDispatch method:
$this->view->flashMessenger = $this->_helper->FlashMessenger;

In the initial layout.phtml include:
    <?php
        if ($this->flashMessenger->hasMessages()) {
            print '<div class="flashMessenger-messages"><ul>';
            foreach ($this->flashMessenger->getMessages() as $message) {
                print '<li>'.$this->escape($message).'</li>';
            }   
            print '</ul></div>';
        }   
    ?>

And because the FlashMessenger doesn't currently support the translator, it
will need to be overridden to include this functionality:
Refer to the attached example file
Project_Controller_Action_Helper_FlashMessenger.

Original issue reported on code.google.com by ces....@gmail.com on 10 Jun 2008 at 10:15

Attachments:

GoogleCodeExporter commented 9 years ago
I think I'd prefer to create a new view helper class instead of assigning the 
flash
messenger helper directly to the view, but the need for something like this as 
the
view layer is obviously something people want.

I'm going to do some further investigation on this to figure out how to 
integrate the
translation support.

Original comment by justin.h...@gmail.com on 11 Jun 2008 at 12:46

GoogleCodeExporter commented 9 years ago

Original comment by justin.h...@gmail.com on 11 Jun 2008 at 12:46

GoogleCodeExporter commented 9 years ago

Original comment by justin.h...@gmail.com on 11 Jun 2008 at 12:47

GoogleCodeExporter commented 9 years ago
I should've mentioned that I stole the getTranslator method from
Zend_View_Helper_Translate.

Original comment by ces....@gmail.com on 11 Jun 2008 at 4:02

GoogleCodeExporter commented 9 years ago

Original comment by justin.h...@gmail.com on 8 Dec 2008 at 3:53

GoogleCodeExporter commented 9 years ago

Original comment by justin.h...@gmail.com on 8 Dec 2008 at 3:53