Skip to content

Controller cheat sheet

MTD edited this page Sep 25, 2015 · 3 revisions

This is an overview over most common needed methods available in the Controllers.

Methods

  • params() Listing all the POST/PUT/URL/session parameters in the request.
  • params(name) Return the list of values for the given parameter.
  • param(name) Fetch a single parameter by name. If the parameter represents multiple values, only the first is returned.
  • flash(name) Returns a single flash element to the view, which is only valid for a single request. Can be used like: $if(flash.name)$<div>$flash.name$</div>$endif$. So the $if()$ checks if the flash with the given name is present at all.
  • flash(name, value) Same as flash(name), but returns value instead of just name.

Clone this wiki locally