/**
  * {@inheritdoc}
  */
 public function formatAttributesCollection(AttributeCollection $collection)
 {
     $attributes = [];
     $collection->forAll(function (Attribute $attribute) use(&$attributes) {
         $attributes[$attribute->getName()] = $this->formatAttributeValue($attribute);
     });
     return $attributes;
 }
Esempio n. 2
0
 /**
  * {@inheritdoc}
  */
 public function prepareAttributesCollection(AttributeCollection $collection)
 {
     $collection->add(new Attribute('sName', $this->getName()));
     $collection->add(new Attribute('sLabel', $this->getOption('label')));
     $collection->add(new Attribute('sClass', $this->getOption('class')));
     $collection->add(new Attribute('fType', $this->getJavascriptNodeName($this), Attribute::TYPE_FUNCTION));
 }
Esempio n. 3
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));
     }
 }