Back to BaseLayout class

Method set

public self
set
(mixed $key, mixed $value)
Method to set a value in the data array. Example: $layout->set('items', $items);
Parameters
  • string $key Key for the data array
  • mixed $value Value to assign to the key
Returns
  • self
Since
  • 3.5
Class: BaseLayout
Project: Joomla

Method set - Source code

/**
 * Method to set a value in the data array. Example: $layout->set('items', $items);
 *
 * @param   string  $key    Key for the data array
 * @param   mixed   $value  Value to assign to the key
 *
 * @return  self
 *
 * @since   3.5
 */
public function set($key, $value)
{
    $this->data[(string) $key] = $value;
    return $this;
}