當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Tag::__construct方法代碼示例

本文整理匯總了PHP中Tag::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP Tag::__construct方法的具體用法?PHP Tag::__construct怎麽用?PHP Tag::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Tag的用法示例。


在下文中一共展示了Tag::__construct方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 public function __construct($text, $value = '', $selected = false)
 {
     parent::__construct('option');
     $this->_text = $this->add(new Text($text), true);
     $this->_value = $this->attribute('value', $value, true);
     $this->_selected = $this->attribute('selected', $selected ? 'selected' : '', true);
 }
開發者ID:TechnoSoluciones,項目名稱:B2C,代碼行數:7,代碼來源:Option.php

示例2: __construct

 public function __construct($type = null)
 {
     parent::__construct('i');
     if ($type) {
         $this->setType($type);
     }
 }
開發者ID:par-orillonsoft,項目名稱:phpwebsite,代碼行數:7,代碼來源:Icon.php

示例3: __construct

 /**
  *
  * @param string $href
  */
 public function __construct($href = '')
 {
     parent::__construct('link');
     $this->attribute('type', 'text/css');
     $this->attribute('rel', 'stylesheet');
     $this->href = $this->attribute('href', $href, true);
 }
開發者ID:TechnoSoluciones,項目名稱:B2C,代碼行數:11,代碼來源:Link.class.php

示例4: __construct

 /**
  *
  * @param string $doctype
  * @param string $xmlns
  * @param string $charset
  * @param string $title
  * @param string $css
  * @param string $jq
  * @param string $jqm
  */
 public function __construct($doctype = Container::DOCTYPE, $xmlns = Container::XMLNS, $charset = Container::CHARSET, $title = Container::TITLE, $css = Container::CSS, $jq = Container::JQUERY_PATH, $jqm = Container::JQUERY_MOBILE_PATH)
 {
     parent::__construct('html');
     $this->_doctype = new Text($doctype);
     $this->head = $this->add(new Head($xmlns, $charset, $title, $css, $jq, $jqm), true);
     $this->body = $this->add(new Body(), true);
 }
開發者ID:TechnoSoluciones,項目名稱:B2C,代碼行數:17,代碼來源:Html.class.php

示例5: __construct

 /**
  * @param array $config Configuration options
  * @param string[] $config['classes'] CSS class names to add
  * @param string $config['id'] HTML id attribute
  * @param string $config['text'] Text to insert
  * @param array $config['content'] Content to append (after text), strings
  *   or Element objects. Strings will be HTML-escaped for output, use an
  *   HtmlSnippet instance to prevent that.
  * @param mixed $config['data'] Element data
  */
 public function __construct(array $config = array())
 {
     // Parent constructor
     parent::__construct($this->getTagName());
     // Initialization
     if (isset($config['infusable']) && is_bool($config['infusable'])) {
         $this->setInfusable($config['infusable']);
     }
     if (isset($config['data'])) {
         $this->setData($config['data']);
     }
     if (isset($config['classes']) && is_array($config['classes'])) {
         $this->ownClasses = $config['classes'];
         $this->addClasses($this->ownClasses);
     }
     if (isset($config['id'])) {
         $this->setAttributes(array('id' => $config['id']));
     }
     if (isset($config['text'])) {
         // JS compatibility
         $this->appendContent($config['text']);
     }
     if (isset($config['content'])) {
         $this->appendContent($config['content']);
     }
 }
開發者ID:MediaWiki-stable,項目名稱:1.26.1,代碼行數:36,代碼來源:Element.php

示例6: __construct

 /**
  *
  * @staticvar array $default_ids Contains default ids for input to prevent repeats
  * @param string $name Input name
  * @param mixed $value Default value sent (radio, checkbox) or filled in (text)
  * @param string $label Label associated with input
  */
 public function __construct($name, $value = null, $label = null)
 {
     static $default_ids = array();
     $this->label = new Label();
     $this->setName($name);
     if (!isset($default_ids[$this->tag_type])) {
         $default_ids[$this->tag_type] = 1;
     }
     $id_name = preg_replace('|[\\W_]+|', '-', preg_replace('/\\[|\\]/', '', $this->name));
     if (isset($default_ids[$id_name])) {
         $default_ids[$id_name]++;
         $id_name = $id_name . '-' . $default_ids[$id_name];
     } else {
         $default_ids[$id_name] = 1;
     }
     $this->setId($id_name);
     $this->type = strtolower($this->popClass());
     parent::__construct($this->tag_type, $value);
     // this MUST come after the above construct
     $this->addIgnoreVariables('has_label', 'label_location');
     $this->label->addClass($this->getType() . '-label');
     if ($label) {
         $this->label->setText($label);
     }
 }
開發者ID:HaldunA,項目名稱:phpwebsite,代碼行數:32,代碼來源:Base.php

示例7: __construct

 public function __construct($text = null, $for = null)
 {
     if (isset($for)) {
         $this->setFor($for);
     }
     parent::__construct('label', $text);
 }
開發者ID:HaldunA,項目名稱:phpwebsite,代碼行數:7,代碼來源:Label.php

示例8: __construct

 /**
  *
  * @param string $id
  * @param array $attributes
  * @param array $items
  * @param string $theme
  * @param boolean $fullscreen
  * @param boolean $nobackbtn
  */
 public function __construct($id, array $attributes = array(), array $items = array(), $theme = '', $fullscreen = false, $nobackbtn = false)
 {
     parent::__construct('div', $id, $attributes, $items, $theme);
     if (count($items) > 0) {
         foreach ($items as $item) {
             if ($item instanceof Header) {
                 $this->_header = $this->add($item, true);
             } elseif ($item instanceof Content) {
                 $this->_content = $this->add($item, true);
             } elseif ($item instanceof Footer) {
                 $this->_footer = $this->add($item, true);
             }
         }
     }
     if (!$this->_header) {
         $this->_header = $this->add(new Header(), true);
     }
     if (!$this->_content) {
         $this->_content = $this->add(new Content(), true);
     }
     if (!$this->_footer) {
         $this->_footer = $this->add(new Footer(), true);
     }
     $this->_role = $this->addAttribute(new Attribute('data-role', 'page'), true);
     $this->_fullscreen = $this->addAttribute(new Attribute('data-fullscreen', $fullscreen === true ? 'true' : ''), true);
     $this->_nobackbtn = $this->addAttribute(new Attribute('data-nobackbtn', $nobackbtn === true ? 'true' : ''), true);
 }
開發者ID:TechnoSoluciones,項目名稱:B2C,代碼行數:36,代碼來源:Page.php

示例9: __construct

 public function __construct($label, $href = null)
 {
     parent::__construct('a', $label);
     $this->addIgnoreVariables('rel');
     if ($href) {
         $this->setHref($href);
     }
 }
開發者ID:HaldunA,項目名稱:phpwebsite,代碼行數:8,代碼來源:Link.php

示例10: __construct

 /**
  *
  * @param string $id
  * @param array $attributes
  * @param array $items
  * @param string $theme
  */
 public function __construct($id = '', array $attributes = array(), array $items = array(), $theme = '')
 {
     parent::__construct('div', $id, $attributes, $items, $theme);
     $this->_role = $this->attribute('data-role', 'navbar', true);
     $this->items()->prefix('<ul><li>');
     $this->items()->separator('</li><li>');
     $this->items()->suffix('</li></ul>');
 }
開發者ID:TechnoSoluciones,項目名稱:B2C,代碼行數:15,代碼來源:Navbar.php

示例11: __construct

 /**
  * @param string $id
  * @param array $attributes
  * @param array $items
  * @param string $theme
  * @param string $title
  * @param string $position
  * @param bool $uiBar
  */
 public function __construct($id = '', $attributes = array(), $items = array(), $theme = '', $title = '', $position = 'inline', $uiBar = false)
 {
     parent::__construct('div', $id, $attributes, $items, $theme);
     $this->_role = $this->attribute('data-role', 'header', true);
     $this->_position = $this->attribute('data-position', $position, true);
     $this->_uiBar = $this->attribute('class', $uiBar ? 'ui-bar' : '', true);
     $this->_title = $this->add(new Title($title), true);
 }
開發者ID:TechnoSoluciones,項目名稱:B2C,代碼行數:17,代碼來源:Header.php

示例12: __construct

 /**
  *
  * @param string $id
  * @param array $attributes
  * @param array $items
  * @param string $theme
  * @param string $title
  * @param boolean $collapsed
  */
 public function __construct($id = '', array $attributes = array(), array $items = array(), $theme = '', $title = '', $collapsed = true)
 {
     parent::__construct('div', $id, $attributes, array(), $theme);
     $this->_role = $this->attribute('data-role', 'collapsible', true);
     $this->_collapsed = $this->attribute('data-collapsed', $collapsed ? 'true' : 'false', true);
     $this->_title = $this->add(new Title($title), true);
     $this->items()->addFromArray($items);
 }
開發者ID:TechnoSoluciones,項目名稱:B2C,代碼行數:17,代碼來源:Collapsible.php

示例13: time

 /**
  * Return a script object
  *
  * @param string $source 
  * @param string $options 
  * @return LinkCss
  * @author Justin Palmer
  */
 function __construct($source, $options = '')
 {
     $app_path = Registry::get('pr-install-path');
     if ($app_path != null) {
         $source = $app_path . 'public/javascript/' . $source . '?' . time();
     }
     $this->options = "src:{$source},type:text/javascript";
     parent::__construct($options);
 }
開發者ID:ToddBudde,項目名稱:phrails,代碼行數:17,代碼來源:Script.php

示例14: __construct

 /**
  *
  * @param string $id
  * @param string $legend
  * @param array $items
  * @param string $theme
  * @param string $dataType
  * @param boolean $fieldContain
  */
 public function __construct($id = '', $legend = '', array $items = array(), $theme = '', $dataType = 'vertical', $fieldContain = false)
 {
     parent::__construct('fieldset', $id, array(), array(), $theme);
     $this->_legend = $this->add(new Tag('legend', '', array(), array($legend)), true);
     $this->items()->addFromArray($items);
     $this->_role = $this->addAttribute(new Attribute('data-role', 'controlgroup'), true);
     $this->_dataType = $this->addAttribute(new Attribute('data-type', $dataType), true);
     $this->_fieldContain = $fieldContain;
 }
開發者ID:TechnoSoluciones,項目名稱:B2C,代碼行數:18,代碼來源:Checkboxgroup.php

示例15: __construct

 /**
  *
  * @staticvar int $default_id  Helps in the creation of form ids if none is set
  */
 public function __construct()
 {
     parent::__construct('form');
     $this->action = \Server::getCurrentUrl();
     static $default_id = 1;
     $this->setId('form-' . $default_id);
     $default_id++;
     $this->addClass('phpws-form');
 }
開發者ID:HaldunA,項目名稱:phpwebsite,代碼行數:13,代碼來源:Form.php


注:本文中的Tag::__construct方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。