JRequest/getFloat: Difference between revisions
From Joomla! Documentation
m clean up |
m preparing for archive only |
||
| Line 4: | Line 4: | ||
===Syntax=== | ===Syntax=== | ||
| Line 45: | Line 45: | ||
===Examples=== | ===Examples=== | ||
=== Code Examples === | |||
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=getFloat | category=getFloat | ||
category=JRequest | category=JRequest | ||
namespace=CodeExample | |||
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
Latest revision as of 02:01, 25 March 2017
Description
Fetches and returns a given filtered variable. The float filter only allows digits and periods. This is currently only a proxy function for getVar().
Syntax
static getFloat($name, $default=0.0, $hash= 'default')
| Parameter Name | Default Value | Description |
|---|---|---|
| $name | $name Variable name. | |
| $default | 0.0 | $default Default value if the variable does not exist. |
| $hash | 'default' | $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD). |
Returns
float Requested variable.
Defined in
libraries/joomla/environment/request.php
Importing
jimport( 'joomla.environment.request' );
Source Body
public static function getFloat($name, $default = 0.0, $hash = 'default')
{
return self::getVar($name, $default, $hash, 'float');
}
Examples
Code Examples