$request->get($key, $default = null)

Returns any value of the request data by key

  • return (string)
// without fallback (will return null if the key does not exist)
echo kirby()->request()->get('myvar');

// with fallback (will return the default value if the key does not exist)
echo kirby()->request()->get('myvar', 'default value');

// shortcut helper
echo get('myvar');
echo get('myvar', 'default value')

Is something missing or incorrect? Edit this page on Github…