Hello. Tell me, please, what does this code mean?
$params->def( 'menutype', 'mainmenu' );
Is $ params variable assigned?
This code means that the object contained in the $params
variable called the def
method with two parameters 'menutype', 'mainmenu'
. Without source, it is impossible to understand how variables change within an object / class.
In Joomla, this code means: if in the parameters (component / module) the value of the variable with the identifier 'menutype'
, then the value of this variable will be returned. If it is not specified, then the 'mainmenu'
(default value) will be returned. Those. $params->def
similar to $params->get
. With the only difference that get
returns either the value of a variable or NULL
. And def
returns either the value of a variable or a default value.
Source: https://ru.stackoverflow.com/questions/21866/
All Articles