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

  • SEARCH
  • Home
  • 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 8560483
In Process

The Archive Base Latest Questions

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

How can i use flash messenger in zend freamwork 2? Session documentation is not

  • 0

How can i use flash messenger in zend freamwork 2? Session documentation is not yet. Anyone know it? But session libraries are there.

  • 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-11T16:17:09+00:00Added an answer on June 11, 2026 at 4:17 pm

    i have written a post about this some time ago. You can find it right here

    Basically you use it just the same like earlier.

    <?php
    public function commentAction()
    {
        // ... display Form
        // ... validate the Form
        if ($form->isValid()) {
            // try-catch passing data to database
    
            $this->flashMessenger()->addMessage('Thank you for your comment!');
    
            return $this->redirect()->toRoute('blog-details'); //id, blabla
        }
    }
    
    public function detailsAction()
    {
        // Grab the Blog with given ID
        // Grab all Comments for this blog
        // Assign the view Variables
    
        return array(
            'blog' => $blog,
            'comments' => $comments,
            'flashMessages' => $this->flashMessenger()->getMessages()
        );
    }
    

    Then in your .phtml file you do it like this:

    // details.phtml
    <?php if(count($flashMessages)) : ?>
    <ul>
        <?php foreach ($flashMessages as $msg) : ?>
        <li><?php echo $msg; ?></li>
        <?php endforeach; ?>
    </ul>
    <?php endif; ?>
    

    Obviously this isn’t all too handy, as you have to do this for every single .phtml file. Therefore doing it within the layout you have to do it at best like the following:

    <?php
    // layout.phtml
    // First get the viewmodel and all its children (ie the actions viewmodel)
    $children = $this->viewModel()
                     ->getCurrent()
                     ->getChildren();
    
    $ourView  = $children[0];
    
    if (isset($ourView->flashMessages) && count($ourView->flashMessages)) : ?>
    <ul class="flashMessages">
        <?php foreach ($ourView->flashMessages as $fMessage) : ?>
        <li><?php echo $fMessage; ?></li>
        <?php endforeach; ?>
    </ul>
    <?php endif; ?>
    

    If you need further description, please see my blog, but i guess the code itself is pretty clear (apart frmo the layout.phtml example). Alternatively you’re always free to write your own view helper to have it look a little cleaner inside your view-templates.

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

Sidebar

Related Questions

is there a unique device ID that I can use in Flash Builder/AS3 to
I know you can either open a separate window, use Flash or frames (yuk)
I have a flash file that include external ActionScript, I can use trace but
I can use FlashWindowEx to make a window flash in the taskbar, but what
I can use .button() to create beautiful submit buttons, but the rest of the
Are there any free audio players that I can use in my website? Are
Flash can use 2 types of fonts such that they can be changed at
Apparently, in Flash 10, you can use the GPU to calculate shaders, and if
I am having difficulty in getting the session values when I use the Flash
I am using swfUpload plugin with paperclip which use flash to upload images but

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.