Created
February 13, 2016 18:54
-
-
Save adamthebig/84f2dd12435e1a5886f1 to your computer and use it in GitHub Desktop.
Craft request cheat sheet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# 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. #} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment