WireInput class

Provides a means to get user input from URLs, GET, POST, and COOKIE variables and more.

Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the WireInput class also inherits all the methods and properties of: Wire.

Show class?             Show args?        

Common

NameReturnSummary 
WireInput::cookie()
null mixed WireInputDataRetrieve a named COOKIE variable value or all COOKIE variables
Can also be used as property: WireInput::cookie
 
WireInput::get()
null mixed WireInputDataRetrieve a named GET variable value, or all GET variables (from URL query string)
Can also be used as property: WireInput::get
 
WireInput::httpsUrl()
stringSame as httpUrl() method but always uses https scheme, rather than current request scheme 
WireInput::post()
null mixed WireInputDataRetrieve a named POST variable value, or all POST variables
Can also be used as property: WireInput::post
 
WireInput::requestMethod()
string boolReturn the current request method (i.e. GET, POST, etc.) or blank if not known 
WireInput::setLazy()
(nothing)Set for lazy loading 
WireInput::whitelist()
null mixed WireInputDataGet or set a whitelist variable
Can also be used as property: WireInput::whitelist
 

URL segments

NameReturnSummary 
WireInput::pageNum()
intReturn the current pagination/page number (starting from 1)
Can also be used as property: WireInput::pageNum
 
WireInput::pageNumStr()
stringReturn the string that represents the page number URL segment 
WireInput::setPageNum(int $num)
(nothing)Set the current page number. 
WireInput::setUrlSegment(int $num, $value)
(nothing)Set a URL segment value 
WireInput::urlSegment()
stringRetrieve the URL segment with the given index (starting from 1) 
WireInput::urlSegment1 string First URL segment  
WireInput::urlSegment2 string Second URL segment  
WireInput::urlSegment3 string Third URL segment, and so on...  
WireInput::urlSegmentStr()
stringGet the string of URL segments separated by slashes
Can also be used as property: WireInput::urlSegmentStr
 
WireInput::urlSegments()
arrayRetrieve array of all URL segments
Can also be used as property: WireInput::urlSegments
 

URLs

NameReturnSummary 
WireInput::httpHostUrl()
stringGet current scheme and URL for hostname without any path or query string 
WireInput::httpUrl()
stringGet the http URL that initiated the current request, including scheme, URL segments and page numbers
Can also be used as property: WireInput::httpUrl
 
WireInput::queryString()
stringReturn the unsanitized query string that was part of this request, or blank if none
Can also be used as property: WireInput::queryString
 
WireInput::scheme()
stringReturn the current access scheme/protocol
Can also be used as property: WireInput::scheme
 
WireInput::url()
stringGet the URL that initiated the current request, including URL segments and page numbers
Can also be used as property: WireInput::url
 

Additional methods and properties

In addition to the methods and properties above, WireInput also inherits the methods and properties of these classes:

API reference based on ProcessWire core version 3.0.123

Twitter updates

  • New post: In this week’s post, we’ll take a look a look at the new website and focus on some parts of it and how they were built. Then we’ll dive into the latest version of ProcessWire on the dev branch, version 3.0.124— More
    11 January 2019
  • New ProcessWire main site rebuild ready for preview— More
    4 January 2019
  • Happy Holidays! This latest master version of ProcessWire contains hundreds of new additions, fixes, optimizations and more. This post covers all the highlights— More
    21 December 2018

Latest news

  • ProcessWire Weekly #244
    In the 244th issue of ProcessWire Weekly we'll cover the latest core updates, introduce the new processwire.com site, ask a PHP version related question in the weekly poll, and showcase the site of an open source room bookings app. Read on!
    Weekly.pw / 12 January 2019
  • ProcessWire 3.0.124 and new website launched
    In this week’s post, we’ll take a look a look at the new website and focus on some parts of it and how they were built. Then we’ll dive into the latest version of ProcessWire on the dev branch, version 3.0.124.
    Blog / 11 January 2019
  • Subscribe to weekly ProcessWire news

“Yesterday I sent the client a short documentation for their ProcessWire-powered website. Today all features already used with no questions. #cmsdoneright—Marc Hinse, Web designer/developer