Back to Cookie class

Method __construct

public
__construct
(array $source = null, array $options = array())
Constructor.
Parameters
  • array $source Ignored.
  • array $options Array of configuration parameters (Optional)
Since
  • 1.7.0
Deprecated
  • 5.0
Class: Cookie
Project: Joomla

Method __construct - Source code

/**
 * Constructor.
 *
 * @param   array  $source   Ignored.
 * @param   array  $options  Array of configuration parameters (Optional)
 *
 * @since   1.7.0
 * @deprecated  5.0  Use Joomla\Input\Cookie instead
 */
public function __construct(array $source = null, array $options = array())
{
    if (isset($options['filter'])) {
        $this->filter = $options['filter'];
    } else {
        $this->filter = InputFilter::getInstance();
    }
    // Set the data source.
    $this->data =& $_COOKIE;
    // Set the options for the class.
    $this->options = $options;
}