Esempio n. 1
0
 /**
  * Constructor
  *
  * @param Src|string $src
  * @param string $type
  * @param string $charset
  * @param boolean $defer
  * @param boolean $async
  * @param string $content
  */
 public function __construct($src = null, $type = null, $charset = null, $defer = false, $async = false, $content = null)
 {
     $attributes = array();
     if (null != $src) {
         if ($src instanceof Src) {
             $srcAttribute = $src;
         } else {
             $srcAttribute = new Src($src);
         }
         $attributes[] = $srcAttribute;
     }
     if (null != $type) {
         $typeAttribute = new Type($type);
         $attributes[] = $typeAttribute;
     }
     if (null != $charset) {
         $charsetAttribute = new Charset($charset);
         $attributes[] = $charsetAttribute;
     }
     if (null != $defer) {
         $deferAttribute = new Defer();
         $attributes[] = $deferAttribute;
     }
     if (null != $async) {
         $asyncAttribute = new Async();
         $attributes[] = $asyncAttribute;
     }
     parent::__construct(self::NAME, $attributes, self::SELF_CLOSING, $content);
 }
Esempio n. 2
0
 /**
  * Contructor
  *
  * @param array $attributes
  */
 public function __construct($attributes = array())
 {
     parent::__construct(self::NAME, $attributes, self::SELF_CLOSING);
 }
Esempio n. 3
0
 /**
  * Constructor
  *
  * @param string $content
  */
 public function __construct($content = null)
 {
     $attributes = array();
     parent::__construct(self::NAME, $attributes, self::SELF_CLOSING, $content);
 }