Note that there are some explanatory texts on larger screens.

plurals
  1. POchange position of the flash message
    primarykey
    data
    text
    <p>I have something like this:</p> <p>controller.</p> <pre><code>public function add() { $this-&gt;layout = 'home'; $this-&gt;Session-&gt;destroy(); if ($this-&gt;request-&gt;is('post')) { $this-&gt;Session-&gt;setFlash(__('xxx', true)); } } </code></pre> <p>view. home.ctp</p> <pre><code>&lt;div id="container"&gt; &lt;div id="header"&gt; &lt;/div&gt; &lt;div id="content"&gt; &lt;?php echo $this-&gt;fetch('content'); ?&gt; &lt;/div&gt; &lt;div id="footer"&gt; &lt;?php echo $this-&gt;Session-&gt;flash(); ?&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>My question is: Why the flash message is not showed in the footer? well, what I want is show the message below the form, but to simplify the problem, with this code the message is also showed in the top. But should be in the footer. Also if i delete</p> <pre><code> &lt;?php echo $this-&gt;Session-&gt;flash(); ?&gt; </code></pre> <p>the message is also showed on the top of the page.</p> <p>So, how can i change the position of this flash message?</p> <p><strong>Edit:</strong></p> <pre><code>&lt;?php var_dump($this-&gt;fetch('content')); ?&gt; </code></pre> <p>output:</p> <pre><code>string '&lt;div id="flashMessage" class="message"&gt; The user xxxxx&lt;/div&gt; &lt;div class="users form"&gt; &lt;form action="/cake/users/add" id="UserAddForm" method="post" accept-charset="utf-8"&gt;&lt;div style="display:none;"&gt;&lt;input type="hidden" name="_method" value="POST"/&gt;&lt;/div&gt; &lt;fieldset&gt; &lt;legend&gt; Add User &lt;/legend&gt; &lt;div class="input text required error"&gt;&lt;label for="UserUsername"&gt;Username&lt;/label&gt;&lt;input name="data[User][username]" maxlength="50" type="text" value="" id="UserUsername" class="form-er'... (length=1187) </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload