php - Customizing the style and location of $session->flash's output in CakePHP 1.2 -
I am writing a simple web application using KPPHP version 1.2 (latest) and I am having a problem with displaying flash message.
In my layout from the session assistant, the following code exists:
Which of the following elements provides:
& lt ;? Php if ($ session- & gt; check ('Message.flash')):? & Gt; & Lt ;? Php $ class = isset ($ error)? 'ContentError': 'contentSuccess'; ? & Gt; & Lt; Div class = "contentbllockwrapper"? Php echo $ class;; & gt; " & Gt; & Lt; Div class = "contentblock" & gt; & Lt; Div id = "flashmessage" class = "flash" & gt; & Lt ;? Php $ session- & gt; Flash (); ? & Gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt ;? Php endif; ? & Gt; The desired behavior is that, if a flash message is displayed, it will be displayed at the above location above the DOM so that it can be styled and deployed as my wish. Could.
The problem is that, if there is a flash message, then open the KPHHP & lt; Body & gt; Now rendering immediately after the tag , it also provides the containers described above in the right place, but does not write the text where I need it.
I tried to flush the output buffer in my view and the echo is that, but to no avail I have also read that some people have used names to display specific messages , But this is not suitable because this text which I want to display is being displayed in the wrong place only.
Any help would be appreciated - thanks!
I think you probably have a layout that says
< Code> $ session-> Flash ();
Then the Flash is render there and is clean. This is the reason why it has not been provided in your element.
Check your ~ / app / views / layout / default.ctp (or other if you are not using the default) and let us know whether it helps.
Comments
Post a Comment