Example #1
0
 /**
  * Sets data attributes onto the element for the jQuery ElementCollection
  *  plugin, to have it determine which buttons to create.
  * @param CollectionElement $collectionElement
  */
 public function setJqueryElementCollectionPluginData(Collection $collectionElement)
 {
     $collectionElement->setAttribute('data-add', $collectionElement->allowAdd());
     $collectionElement->setAttribute('data-remove', $collectionElement->allowRemove());
     $collectionElement->setAttribute('data-count', $collectionElement->getOption('count') ?: 0);
 }