Example #1
0
 /**
  * Adds javascript rules to element
  *
  * @param ElementInterface    $element
  * @param AttributeCollection $collection
  */
 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));
     }
 }