API16:JParameter/def
From Joomla! Documentation
Description
Sets a default value if not alreay assigned.
Syntax
def($key, $default= '', $group= '_default')
| Parameter Name | Default Value | Description |
|---|---|---|
| $key | The name of the param. | |
| $default | The value of the parameter. | |
| $group | '_default' | The parameter group to modify. |
Returns
string The set value.
Defined in
libraries/joomla/html/parameter.php
Importing
jimport( 'joomla.html.parameter' );
Source Body
public function def($key, $default = '', $group = '_default')
{
$value = $this->get($key, (string) $default, $group);
return $this->set($key, $value);
}
Examples
Code Examples