vendor/menatwork/semantic_html5/src/Elements/Start.php line 43

Open in your IDE?
  1. <?php
  2. /**
  3.  * Contao Open Source CMS
  4.  * Copyright (c) 2005-2015 Leo Feyer
  5.  *
  6.  * @package    semantic_html5
  7.  * @copyright  MEN AT WORK 2016
  8.  * @author     David Maack <david.maack@arcor.de>
  9.  * @license    LGPL-3.0+
  10.  */
  11. namespace SemanticHTML5\Elements;
  12. use SemanticHTML5\Frontend\Helper;
  13. /**
  14.  * Semantic html5 start element
  15.  * 
  16.  * @property string $sh5_additional 
  17.  * @property string $sh5_type
  18.  */
  19. class Start extends \ContentElement
  20. {
  21.     /**
  22.      * Template
  23.      * @var string
  24.      */
  25.     protected $strTemplate 'ce_semantic_html5_start';
  26.     /**
  27.      * Generate the content element
  28.      */
  29.     protected function compile()
  30.     {
  31.         //parse all extra attributes
  32.         $attributes '';
  33.         $helper = new Helper();
  34.         if ($this->sh5_additional) {
  35.             /** @var array $additionalAttributes */
  36.             $additionalAttributes deserialize($this->sh5_additionaltrue);
  37.             $attributes $helper->convertAttributesToString($additionalAttributes'tl_content'); 
  38.         }
  39.         $this->Template->sh5_additional $attributes;
  40.         //render BE-Template
  41.         if (TL_MODE == 'BE') {
  42.             $this->Template = new \BackendTemplate('be_wildcard');
  43.             $this->Template->wildcard sprintf("&lt;%s%s%s%s&gt;",
  44.                     $this->sh5_type,
  45.                     ($this->cssID[0]) ? ' id="' $this->cssID[0] . '"' '',
  46.                     ' class="' trim('ce_' $this->type ' ' $this->cssID[1]) . '"',
  47.                     $attributes
  48.             );
  49.             return $this->Template->parse();
  50.         }
  51.     }
  52. }