Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-21-2008, 04:00 PM
Junior Member
 
Join Date: Apr 2008
Posts: 2
Default FlashMessenger problem

hi,
I'm not able to read the messages from FlashMessenger after redirect.
I've learnt the Q. Zervaas book and i applied your method:

PHP Code:
class CustomControllerAction extends Zend_Controller_Action
    
{
        public 
$db;
        public 
$breadcrumbs;
        public 
$messenger;

        public function 
init()
        {
            
$this->db Zend_Registry::get('db');

            
$this->breadcrumbs = new Breadcrumbs();
            
$this->breadcrumbs->addStep('Home'$this->getUrl(null'index'));

            
$this->messenger $this->_helper->_flashMessenger;
           
// $this->messenger = $this->_helper->getHelper('FlashMessenger');
            
        
}
...

public function 
postDispatch()
        {
            
$this->view->breadcrumbs $this->breadcrumbs;
            
$this->view->title $this->breadcrumbs->getTitle();
            
            
$this->view->messages $this->messenger->getMessages();
            


            
$this->view->isXmlHttpRequest $this->getRequest()->isXmlHttpRequest();

            
$this->view->config Zend_Registry::get('config');
        } 
I added the messages with $this->messenger->addMessage('message'), but, after redirect, getMessages() is empty.

Any Ideas?

Thanks
Ludo
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-28-2008, 04:13 PM
troy's Avatar
Junior Member
 
Join Date: Apr 2008
Posts: 11
Default

PHP Code:
class SomeController extends Zend_Controller_Action
{
    protected 
$_flashMessenger null;
    
    public function 
init()
    {
        
parent::init();
        
$this->_flashMessenger $this->_helper->getHelper('FlashMessenger');
        
$this->initView();
    }

    public function 
indexAction()
    {
        
$this->_flashMessenger->addMessage('Record Saved!');
    }

    public function 
postAction()
    {
        
$msg = $$this->_flashMessenger->getMessages();
        foreach(
$msg as $v){
            
$this->view->message $v.'<br />';
        } 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 12:30 PM.