Example #1
0
 /**
  * @param string $elementType
  * @return string
  */
 public function renderElementAttributes($elementType)
 {
     $resultAttributes = [];
     foreach ($this->pageConfig->getElementAttributes($elementType) as $name => $value) {
         $resultAttributes[] = sprintf('%s="%s"', $name, $value);
     }
     return implode(' ', $resultAttributes);
 }
Example #2
0
 /**
  * @param string $elementType
  * @param string $attributes
  *
  * @dataProvider elementAttributesDataProvider
  */
 public function testElementAttributes($elementType, $attributes)
 {
     foreach ($attributes as $attribute => $value) {
         $this->model->setElementAttribute($elementType, $attribute, $value);
     }
     $this->assertEquals($attributes, $this->model->getElementAttributes($elementType));
 }
Example #3
0
 /**
  * @param string $elementType
  * @param string $attribute
  * @param string $value
  *
  * @dataProvider elementAttributeDataProvider
  */
 public function testElementAttributes($elementType, $attribute, $value)
 {
     $this->model->setElementAttribute($elementType, $attribute, $value);
     $this->assertEquals([$attribute => $value], $this->model->getElementAttributes($elementType));
 }
 /**
  * {@inheritdoc}
  */
 public function getElementAttributes($elementType)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getElementAttributes');
     if (!$pluginInfo) {
         return parent::getElementAttributes($elementType);
     } else {
         return $this->___callPlugins('getElementAttributes', func_get_args(), $pluginInfo);
     }
 }