Cheat Sheet: craft.request

{# Properties #}
{{ craft.request.firstSegment }}
{{ craft.request.isAjax }}
{{ craft.request.isLivePreview }}
{{ craft.request.isSecure }}
{{ craft.request.lastSegment }}
{{ craft.request.pageNum }}
{{ craft.request.path }}
{{ craft.request.segments }}
{{ craft.request.serverName }}
{{ craft.request.url }}

{# Methods #}
{{ craft.request.isMobileBrowser() }}
{{ craft.request.isMobileBrowser(true) }} {# includes tablets #}
{{ craft.request.getCookie( name ) }}
{{ craft.request.getFirstSegment() }}
{{ craft.request.getLastSegment() }}
{{ craft.request.getPageNum() }}
{{ craft.request.getPath() }}
{{ craft.request.getSegment(n) }}
{{ craft.request.getSegments() }}
{{ craft.request.getServerName() }}
{{ craft.request.getUrl() }}

{{ craft.request.getPost(name) }}   {# Returns a parameter from the POST data. #}
{{ craft.request.getQuery(name) }}  {# Returns a parameter from the query string. #}
{{ craft.request.getParam(name) }}  {# Returns a parameter from either the query string or POST data. #}

Don't miss any Craft tips, tricks, and community updates