API15

JParameter/def: Difference between revisions

From Joomla! Documentation

m removing red link to edit, no existant pages
m preparing for archive only
 
Line 52: Line 52:


===Examples===
===Examples===
<CodeExamplesForm />
=== Code Examples ===
<dpl>
<dpl>
  noresultsheader=\n
  noresultsheader=\n
  category=def
  category=def
  category=JParameter
  category=JParameter
  category=CodeExample
  namespace=CodeExample
  category=MethodExample
  category=MethodExample
  include=*
  include=*

Latest revision as of 01:01, 25 March 2017

Description

Sets a default value if not alreay assigned

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

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

function def($key, $default = '', $group = '_default') {
        $value = $this->get($key, (string) $default, $group);
        return $this->set($key, $value);
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

Code Examples