I have something like this:
controller.
public function add() {
$this->layout = 'home';
$this->Session->destroy();
if ($this->request->is('post')) {
$this->Session->setFlash(__('xxx', true));
}
}
view. home.ctp
<div id="container">
<div id="header">
</div>
<div id="content">
<?php echo $this->fetch('content'); ?>
</div>
<div id="footer">
<?php echo $this->Session->flash(); ?>
</div>
</div>
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
<?php echo $this->Session->flash(); ?>
the message is also showed on the top of the page.
So, how can i change the position of this flash message?
Edit:
<?php var_dump($this->fetch('content')); ?>
output:
string '<div id="flashMessage" class="message"> The user xxxxx</div>
<div class="users form">
<form action="/cake/users/add" id="UserAddForm" method="post" accept-charset="utf-8"><div style="display:none;"><input type="hidden" name="_method" value="POST"/></div> <fieldset>
<legend>
Add User
</legend>
<div class="input text required error"><label for="UserUsername">Username</label><input name="data[User][username]" maxlength="50" type="text" value="" id="UserUsername" class="form-er'... (length=1187)