Example #1
0
 /**
  * Constructs a new MetaRefreshElement.
  *
  * @param int $seconds
  *   The number of seconds after which the browser should redirect the user
  *   to the specified URL.
  * @param $url
  *   The URL to which to redirect.
  */
 public function __construct($seconds, $url)
 {
     assert('is_int($seconds)');
     parent::__construct(['http-equiv' => 'refresh', 'content' => "{$seconds};url={$url}"]);
 }
Example #2
0
 /**
  * Constructs a named meta element.
  *
  * @param string $name
  *   The name of the element, for the name attribute.
  * @param string $contentAttribute
  *   The value of the 'content' attribute of the element. Its significance
  *   varies depending on the $name.
  */
 public function __construct($name, $contentAttribute)
 {
     parent::__construct(['name' => $name, 'content' => $contentAttribute]);
 }
Example #3
0
 /**
  * Constructs a new MetaCharset element.
  *
  * @param string $charset
  *   A character set that will apply to the whole page. Rarely will
  *   something other than UTF-8 be used.
  */
 public function __construct($charset = 'UTF-8')
 {
     parent::__construct(['charset' => $charset]);
 }