Back to BaseLayout class

Method get

public mixed
get
(mixed $key, mixed $defaultValue = null)
Method to get the value from the data array
Parameters
  • string $key Key to search for in the data array
  • mixed $defaultValue Default value to return if the key is not set
Returns
  • mixed Value from the data array | defaultValue if doesn't exist
Since
  • 3.5
Class: BaseLayout
Project: Joomla

Method get - Source code

/**
 * Method to get the value from the data array
 *
 * @param   string  $key           Key to search for in the data array
 * @param   mixed   $defaultValue  Default value to return if the key is not set
 *
 * @return  mixed   Value from the data array | defaultValue if doesn't exist
 *
 * @since   3.5
 */
public function get($key, $defaultValue = null)
{
    return $this->data[$key] ?? $defaultValue;
}
OSZAR »