Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9172427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:20:36+00:00 2026-06-17T16:20:36+00:00

I am using Zend 1.12 and php 5.4.3 and flashMessenger->getMessages() has suddenly stopped working

  • 0

I am using Zend 1.12 and php 5.4.3 and flashMessenger->getMessages() has suddenly stopped working in a controller action.

In AController, a certain type of account is created and it takes 9 steps to create it, so I have 9 actions create1-9Action

On each step I pass the form data to the next step using flashmessenger.
This is the typical structure of an action:

public function create5Action()
{
  $form = new My_Form();
  $messages = $this->_helper->flashMessenger->getMessages();
  $data = $messages[0];
  if ($this->_request->isPost())
  {
    if ($form->isValid($this->_request->getPost()))
    {
       /* form treatment */

      $this->_helper->flashMessenger->addMessage($data);
      $this->_redirect($this->_helper->url("create6", "A", null)); // redirect to next step
    }
  }

  $this->_helper->flashMessenger->addMessage($data);
  $this->view->form = $form;
}

In this action (create5) the data is intact when arriving from create4Action, it is intact when adding it as a message before $this->view->form = $form;, but when I add new elements to the form and submit it, $messages = $this->_helper->flashMessenger->getMessages(); is null and I do not know why, since it is working for all other actions.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T16:20:37+00:00Added an answer on June 17, 2026 at 4:20 pm

    You may have missed adding the else in the isPost() loop.

    public function create5Action()
    {
      $form = new My_Form();
      $messages = $this->_helper->flashMessenger->getMessages();
      $data = $messages[0];
      if ($this->_request->isPost())
      {
        if ($form->isValid($this->_request->getPost()))
        {
           /* form treatment */
    
          $this->_helper->flashMessenger->addMessage($data);
          $this->_redirect($this->_helper->url("create6", "A", null)); // redirect to next step
        }
      } else {
    
          $this->_helper->flashMessenger->addMessage($data);
          $this->view->form = $form;
        }
    }
    

    However this is not the anticipated use of the flash messenger. I think a part of your problem is that every time a request is made the flash messenger namespace is cleared during the postDispatch() portion of the dispatch loop.

    You may be better off using your own Zend_Session_Namespace instance instead of relying on the instance that flash messenger is using.

    public function create5Action()
        {
          $session = new Zend_Session_Namespace('data');//set elsewhere and forwarded and can be persistent
          $form = new My_Form();     
          $data = $session->data;
          if ($this->_request->isPost())
          {
            if ($form->isValid($this->_request->getPost()))
            {
               /* form treatment */
    
              $session->newData = $newData;//forward data if needed, old data will persist as you require
              $this->_redirect($this->_helper->url("create6", "A", null)); // redirect to next step
            }
          } else {
              $this->view->form = $form;
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently working on a big management system (in PHP using Zend Framework,
i'm working on a simple mail list app in PHP using Zend Mail. The
I'm using PHP/Zend to load html into a DOM, and then I get a
I have a PHP MVC application using Zend Framework. As presented in the quickstart,
I'm currently using Zend Framework 2 beta for on PHP 5.4.4 to develop a
I've built a search index using the PHP Zend Framework Search (based on Lucene).
I am trying to read some settings from php.ini using zend. The API that
I've read through the Google Spreadsheets API PHP documentation. All examples are using Zend,
All, I have a PHP Web application built using Zend Framework and MVC with
I have 2 applications. App1 is some old selfmade php project, not using Zend.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.