Retrieving request data using JInput: Difference between revisions
From Joomla! Documentation
Remove red link |
Javiparati (talk | contribs) |
||
| Line 8: | Line 8: | ||
Why? Because currently it seems like an afterthought and is easy to miss, but at a guess it's the reason that 95% of users will consult this page. | Why? Because currently it seems like an afterthought and is easy to miss, but at a guess it's the reason that 95% of users will consult this page. | ||
== Explain about this other way to get values == | |||
We missed to explain also this other way to get the filtered values | |||
So instead of this: | |||
<source lang="php"> | |||
$this->input->get('id', 0, 'INT'); | |||
</source> | |||
Do this: | |||
<source lang="php"> | |||
$this->input->getInt('id', 0); | |||
</source> | |||
Latest revision as of 10:33, 7 April 2014
Why not just call this page "JInput"?
Because it will get overwritten the next time I run the Doxygen importer. See, for example, JRequest. Chris Davenport 04:04, 11 October 2011 (CDT)
Needs clarification for normal users
Having just wasted 90 or so minutes trying to work out the equivalent of "Jrequest::getVar" I propose renaming the block curently called "Getting Values from a Specific Super Global" to something like "Getting request values", rewording it slightly, and moving it nearer to the head of the page.
Why? Because currently it seems like an afterthought and is easy to miss, but at a guess it's the reason that 95% of users will consult this page.
Explain about this other way to get values
We missed to explain also this other way to get the filtered values
So instead of this:
$this->input->get('id', 0, 'INT');
Do this:
$this->input->getInt('id', 0);