protected function addElementRules(ElementInterface $element, AttributeCollection $collection)
    {
        if ($element->hasOption('rules') && count($element->getOption('rules'))) {
            $rules = $this->formatter->formatRules($element->getOption('rules'));
            $collection->add(new Attribute('aoRules', $rules, Attribute::TYPE_ARRAY));
        }
    }
protected function addElementRules(ElementInterface $element, AttributeCollection $collection)
    {
        if ($element->hasOption('rules') && count($element->getOption('rules'))) {
            $rules = $this->formatter->formatRules($element->getOption('rules'));
            $collection->add(new Attribute('aoRules', $rules, Attribute::TYPE_ARRAY));
        }
    }
protected function addElementRules ( ElementInterface $ element , AttributeCollection $ collection ) { if ( $ element -> hasOption ( 'rules' ) && count ( $ element -> getOption ( 'rules' ) ) ) { $ rules = $ this -> formatter -> formatRules ( $ element -> getOption ( 'rules' ) ) ; $ collection -> add ( new Attribute ( 'aoRules' , $ rules , Attribute :: TYPE_ARRAY ) ) ; } }
Adds javascript rules to element

@param ElementInterface    $element
@param AttributeCollection $collection
Adds javascript rules to element