Вход Регистрация
Файл: concrete5.7.5.6/concrete/vendor/anahkiasen/html-object/src/HtmlObject/Element.php
Строк: 45
<?php
namespace HtmlObject;

use 
HtmlObjectTraitsHelpers;
use 
HtmlObjectTraitsTag;

/**
 * A classic HTML element
 */
class Element extends Tag
{
  
////////////////////////////////////////////////////////////////////
  //////////////////////////// CORE METHODS //////////////////////////
  ////////////////////////////////////////////////////////////////////

  /**
   * Creates a basic Element
   *
   * @param string $element
   * @param string $value
   * @param array  $attributes
   *
   * @return Element
   */
  
public function __construct($element = null, $value = null, $attributes = array())
  {
    
$this->setTag($element, $value, $attributes);
  }

  
/**
   * Static alias for constructor
   *
   * @param string          $element
   * @param string|null|Tag $value
   * @param array           $attributes
   * @return                Element
   */
  
public static function create($element = null, $value = null, $attributes = array())
  {
    return new static(
$element, $value, $attributes);
  }

  
/**
   * Dynamically create an element
   *
   * @param string $method     The element
   * @param array  $parameters Value and attributes
   *
   * @return Element
   */
  
public static function __callStatic($method, $parameters)
  {
    
$value      = Helpers::arrayGet($parameters, 0);
    
$attributes = Helpers::arrayGet($parameters, 1);

    return new static(
$method, $value, $attributes);
  }
}
Онлайн: 1
Реклама