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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:11:53+00:00 2026-05-24T16:11:53+00:00

In an action, I set some feedback for the user : $this->getUser()->setFlash(‘message’, array( type

  • 0

In an action, I set some feedback for the user :

    $this->getUser()->setFlash('message', array(
    "type" => "notice",
    "content" => "Well done buddy, you did it."
    ));

    $this->redirect('home/index');

In the view, I just use the following code :

<?php if ($sf_user->hasFlash('message')): $message = $sf_user->getFlash('message') ?>
  <p class="<?php echo $message["type"] ?>" ><?php echo $message["content"]?></p>
<?php endif; ?>

But the message never appears.

Not that the problem is not ‘it appears once then it disapears’ cause that would mean it works. The problem is that it never appears. Not once.

I’m using Symfony 1.2, this is why flash var are now binded to the user object.

  • 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-05-24T16:11:55+00:00Added an answer on May 24, 2026 at 4:11 pm

    Try the same with two setFlash with strings (not array). I think this will work. Symfony is escaping arrays when accessing it in the template. try var_dump($sf_user->getFlash('message')); to be sure what you get.

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

Sidebar

Related Questions

I have a UITableViewController and I set some properties in the viewDidLoadMethod like so:
How to set action to the backButtonItem on the navigation bar? I have a
HI, this is my first time doing this. I've read The definitive guide to
I'm working on a GUI application, which relies heavily on Action<> delegates to customize
I have this snippet of code (AJAX) in jQuery. $.get('someScript.php?lat=' + clickedLatLng.lat() + '&lon='
I just recently inherited a Rails application and am debating an architectural decision moving
In rails, is it possible to pass arguments in when making a new object,
I have a classifieds website, and when posting a new ad, users may chose
I want as my application to be structured in 2 parts: the logic code
I have a solution with 2 projects: Windows Phone App and a Windows Phone

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.