EventAction::__construct PHP Method

__construct() public method

public __construct ( $label, $type, $options = null, $htmlOptions = null )
    public function __construct($label, $type, $options = null, $htmlOptions = null)
    {
        $this->label = $label;
        $this->type = $type;
        $this->htmlOptions = $htmlOptions;
        if (!isset($this->htmlOptions['class'])) {
            $this->htmlOptions['class'] = '';
        }
        if (is_array($options)) {
            foreach ($options as $key => $value) {
                $this->options[$key] = $value;
            }
        }
    }

Usage Example

 /**
  * Constructor
  * @param $targetSelector string Selector for target to receive event.
  */
 function __construct($targetSelector, $url, $title)
 {
     parent::__construct($targetSelector, 'addTab', array('url' => $url, 'title' => $title));
 }