get($key = null, $default = null)

Fetches a POST or GET parameter by key

  • $key (string)
    null returns an array of all values
  • $default (mixed)
    Default value if empty
  • return (string)

Example

The most simple search setup

// http://yourdomain.com/search/?q=hello
if($q = get('q')) {
  $results = $site->index()->search($q);
}