![]() The return value from all of the above access methods would be identical. ![]() Whichever way you access an API variable, there’s no need for confusion, simply remember that you are always accessing exactly the same thing. You are always accessing the same exact thing You might even come across more but the above are those you are most likely to see at some point. $this->wire('page') when in Wire-derived classes (preferred method).$this->page when in Wire-derived classes. ![]() For instance, all of the following accesses to the $page API variable are synonyms of each other, though with different benefits depending on the context: There are several different ways to access these API variables. See the API reference for a full list of ProcessWire’s core API variables. For instance, the “pages” (plural) API variable provides access to loading and saving pages, the “page” (singular) API variable provides access to the page being viewed, the “input” API variable provides access to user input, and so on. Regardless of what method you use, you are technically accessing what are called API variables.Įach API variable has a unique name to distinguish it from others. In ProcessWire there are several ways that you can access the API and we take a look at the most common ones here.
0 Comments
Leave a Reply. |