Class Misago\ActionController\Flash

Passes temporary variables to the very next request.

For instance in your controller:

if ($this->article->save())
{
  $this->flash['notice'] = 'Article was successfully created.';
  redirect_to(show_article_path($this->article->id));
} 

Then in your view:

<? if (isset($this->flash['notice'])): ?>
  <div class="notice"><?= $this->flash['notice'] ?></div>
<? endif; ?>

Please note that variables will be forgotten at the end of the following request. Variables are only accessible at request n1, not at request n2, n+3, etc.

Inheritence

Extends:
ArrayObject

Methods

Public instance methods

__construct()

__destruct()

discard($index=null)

Discards either one variable or the whole set.