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 7909669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T12:32:23+00:00 2026-06-03T12:32:23+00:00

So i am creating a project using zend-framwork and i am trying to implement

  • 0

So i am creating a project using zend-framwork and i am trying to implement the flash messenger helper but i cant find any good practice to implement it.
What i need is to use the flash messenger to send a message and redirect, while the message will appear directly in a specific place in the layout.phtml.
I know that for the redirector i can do that:

$redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');
$redirector->gotoUrl('/my-controller/my-action/param1/test/param2/test2')
               ->redirectAndExit();'

What can i do to the flash messanger to make it work ? and what is the best practice for that ?

  • 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-03T12:32:27+00:00Added an answer on June 3, 2026 at 12:32 pm

    In your controller

    public function init()
    {
    $messages = $this->_helper->flashMessenger->getMessages();
    if(!empty($messages))
    $this->_helper->layout->getView()->message = $messages[0];
    }
    

    in your layout.phtml

        <!-- Global notification handling to use call flashMessenger action helper -->
        <?php if(isset($this->message)) :?>
        <div class="notification">
    
        <?php echo $this->message ;?>
    
        </div>    
     <?php endif;?>
    

    Then whenever you want to use it

    public function loginAction()
    {
    $this->_helper->flashMessenger('Login is success');
    $this->_helper->redirector('home');
    }
    

    Almost every-time you will be redirecting after using flashMessenger.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am creating a web project using JSP, and is trying to implement a
I'm trying to include the jquery helper in my zend project, documentation from zend
I am trying to create very first project using django but stuck at very
I am creating serialized XML for a LINQ to SQL project using the DataContractSerializer
I am creating one sample project in android. i am using sample rss feed.
I'm creating a simple CMS using kohana3 in which user can add project to
I'm creating a project from the book Sanderson Pro ASp.net mvc3. But I have
When creating a new project using zf create project myproject it will create a
I'm creating a project using Django. For this project I use git and redmine
I am creating a test project using IBM's Rational Functional Tester(RFT) tool(we are using

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.