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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T12:35:05+00:00 2026-05-19T12:35:05+00:00

I am looking to manipulate the $session->flash() output in my CakePHP app, Currently I

  • 0

I am looking to manipulate the $session->flash() output in my CakePHP app, Currently I have the very simple default implementation of showing flash and auth error messages:

<?php
    $session->flash();
    $session->flash('auth');
?>

This produces a <div> with an ID and class that has the message inside. What I would like to do is wrap/replace the generated HTML, specifically with some jQuery UI classes, but wrapping is difficult as I am unable to tell when there is actually a message going to be displayed so I end up with an empty but style error div. What I really need for wrapping to work is to check in $session->flash() returns anything, but I get ‘can’t use method return value in write context’ when checking it with empty();

As far as I can tell the generated HTML is hard coded into the session helper! Bonus points if you can work out how to change the class on the auth message and normal flash message independently.

  • 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-19T12:35:06+00:00Added an answer on May 19, 2026 at 12:35 pm

    To check if a message is going to be flashed, put this in the layout

    <?php if($session->check('Message')){ echo $this->Session->flash();} ?>
    

    CSS attributs can be set when you set the message to be flashed

    http://book.cakephp.org/view/1311/Methods#setFlash-1313

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

Sidebar

Related Questions

I am looking for a reference that covers using ActiveX to open and manipulate
Looking to do a very small, quick 'n dirty side project. I like the
Looking for suggestions on file system management tools. We have several terabytes of images,
A Note I have a very good understanding of sessions and the theory of
Ive been looking everywhere for something that could manipulate animated gif files, server-side, preferably
I'm looking for a library that could be used to manipulate audio files. Essentially
I'm looking for automated Functional Testing tools that can manipulate SharePoint sites, libraries, and
I'm looking for a good python library to manipulate subversion repositories. I'm trying out
i looking for a manual way of manipulate div element inside uibinder using jquery
Looking for feedback on : http://code.google.com/p/google-perftools/wiki/GooglePerformanceTools

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.