Actions

API16

JParameter/def

From Joomla! Documentation

< API16:JParameter
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

Sets a default value if not alreay assigned.

[Edit Descripton]

Description:JParameter/def

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);
}

[Edit See Also] SeeAlso:JParameter/def

Examples

<CodeExamplesForm />