当前位置: 首页>>代码示例>>PHP>>正文


PHP HtmlElement::addElement方法代码示例

本文整理汇总了PHP中HtmlElement::addElement方法的典型用法代码示例。如果您正苦于以下问题:PHP HtmlElement::addElement方法的具体用法?PHP HtmlElement::addElement怎么用?PHP HtmlElement::addElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HtmlElement的用法示例。


在下文中一共展示了HtmlElement::addElement方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addFormElementContainer

 /**
  * Add element of container that contains form element and caption
  * 
  * @param HtmlElement $inputContainer
  * @param HtmlElement $captionContainer
  */
 protected function addFormElementContainer(HtmlElement $inputContainer, HtmlElement $captionContainer)
 {
     $div = new HtmlElement('div');
     $div->addElement($captionContainer);
     $div->addElement($inputContainer);
     $this->addElement($div);
 }
开发者ID:2626suke,项目名称:curryfw,代码行数:13,代码来源:form_layout_div.php

示例2: addFormElementContainer

 /**
  * Add element of container that contains form element and caption
  * 
  * @param HtmlElement $inputContainer
  * @param HtmlElement $captionContainer
  */
 protected function addFormElementContainer(HtmlElement $inputContainer, HtmlElement $captionContainer)
 {
     $container = new HtmlElement($this->_containerTagName);
     $container->setClass($this->_containerClass);
     $container->addElement($captionContainer);
     $container->addElement($inputContainer);
     $this->_parentForm->addElement($container);
 }
开发者ID:2626suke,项目名称:curryfw,代码行数:14,代码来源:form_layout_standard.php

示例3: addFormElementContainer

 /**
  * Add element of container that contains form element and caption
  * 
  * @param HtmlElement $inputContainer
  * @param HtmlElement $captionContainer
  */
 protected function addFormElementContainer(HtmlElement $inputContainer, HtmlElement $captionContainer)
 {
     if (!$this->_tbody instanceof HtmlElement) {
         $this->_tbody = new HtmlElement('tbody');
         $this->addElement($this->_tbody);
     }
     $tr = new HtmlElement('tr');
     $tr->addElement($captionContainer);
     $tr->addElement($inputContainer);
     $this->_tbody->addElement($tr);
 }
开发者ID:2626suke,项目名称:curryfw,代码行数:17,代码来源:form_layout_table.php

示例4: front

 public function front()
 {
     global $design_head, $content;
     $design_head .= '<script type="text/javascript" src="inc/AJAX/ajax_suggest.js"></script>' . "\n";
     $html = new \HtmlElement("div");
     $html->addCssClass("kiosk");
     // Page title
     $html->addElement("div")->addCssClass("page-title")->addElement("h1", "Kiosk");
     // Print the input field for adding new wares.
     $newProductWrapper = $html->addElement("div")->addCssClass("new-product");
     $newProductForm = $newProductWrapper->addElement("form");
     $newProductForm->setAttribute("action", "?module=kiosk")->setAttribute("method", "post");
     $newProductForm->addElement("input")->setAttribute("type", "text")->setAttribute("name", "product_name")->setAttribute("id", "ware")->setAttribute("placeholder", "Produktnavn...")->setAttribute("tabindex", 1)->setAttribute("autocomplete", "off")->setAttribute("onkeyup", "suggest();");
     // Suggest div for autocomplete.
     $newProductWrapper->addElement("div")->setAttribute("id", "suggest");
     // Productlist
     if ($this->_kioskSession->hasProducts()) {
         $productListWrapper = $html->addElement("div")->addCssClass("products");
         $productListWrapper->addElement("h2", "Handlekurv");
         // Table
         $productListTable = $productListWrapper->addElement("div")->addCssClass("table");
         foreach ($this->_kioskSession->getProducts() as $productArrayItem) {
             /** @var Product $product */
             $product = $productArrayItem["object"];
             $amount = $productArrayItem["amount"];
             $row = $productListTable->addElement("div")->addCssClass("row");
             $row->addElement("div", $product->getName())->addCssClass("cell");
             $row->addElement("div", $amount . " stk")->addCssClass("cell");
             $row->addElement("div", $product->getPrice() . " kr")->addCssClass("cell");
             $options = $row->addElement("div")->addCssClass("cell");
             $options->addElement("a")->setAttribute("href", "?module=kiosk&action=addWare&ware=" . $product->getProductID())->addElement("img")->setAttribute("src", "inc/images/plus-15px.png");
             $options->addElement("a")->setAttribute("href", "?module=kiosk&action=removeWare&ware=" . $product->getProductID())->addElement("img")->setAttribute("src", "inc/images/minus-15px.png");
         }
     }
     $html->addElement("a", "Reset")->setAttribute("href", "?module=kiosk&action=endSession");
     $content .= $html;
 }
开发者ID:hultberg,项目名称:relancms,代码行数:37,代码来源:KioskGui.php

示例5: addHeaderElement

 /**
  * Add header row element
  * 
  * @param HtmlTableRow $row
  * @return HtmlTable
  */
 public function addHeaderElement(HtmlTableRow $row)
 {
     $this->_createHeaderContainer();
     $this->_thead->addElement($row);
     return $this;
 }
开发者ID:2626suke,项目名称:curryfw,代码行数:12,代码来源:html_table.php

示例6: createCheckboxes

 /**
  * Create and return element of input tags whose type are checkbox
  * 
  * @param string $name
  * @param array $list
  * @param string $defaultValue
  * @param array $attributes
  * @return FormElementSet
  */
 public function createCheckboxes($name = null, $list = array(), $defaultValue = null, $attributes = null)
 {
     $this->_checkArgumentIsArray(__METHOD__, 2, $list);
     $frame = $this->createFormElementSet('span');
     if (!is_array($attributes)) {
         $attributes = array();
     }
     $attributes['type'] = 'checkbox';
     if (is_array($list)) {
         foreach ($list as $value => $text) {
             $checkbox = new FormElement('input');
             $checkbox->setIsReturnInner(false);
             $checkbox->setAttributes($attributes);
             $checkbox->setValue($value);
             $label = new HtmlElement('label');
             $label->setIsReturnInner(false);
             $label->addElement($checkbox);
             $label->addNode($text);
             $frame->addElement($label);
         }
     }
     $frame->setName($name);
     if ($defaultValue !== null) {
         $frame->setValue($defaultValue);
     }
     return $frame;
 }
开发者ID:2626suke,项目名称:curryfw,代码行数:36,代码来源:html_form.php

示例7: HtmlElement

            $value->outputAsHTML($lineprefix . ' ');
        }
        if (strlen($this->myBodyText) > 0) {
            print $this->myBodyText;
        }
        print "\n" . $lineprefix . "</" . $this->myTagName . ">";
    }
}
?>

<?php 
$mainDiv = new HtmlElement("div", array("class" => "specialDiv", "name" => "mydivname"));
// create a list of paras
for ($divChild = 0; $divChild < 25; $divChild++) {
    $newPara = new HtmlElement("p", NULL, NULL, "This is " . chr(ord("a") + $divChild) . " paragraph text");
    $mainDiv->addElement($newPara);
    $newPara->addElement(new HtmlElement("a", array("name" => "pName" . $tagNameIDs['p'])));
}
$lastIndexedParaCount = $tagNameIDs['p'];
// create a set of divs where each div has a para
$nestedDiv = new HtmlElement("div", array("class" => "nestedDiv", "name" => "nestedDiv"));
$nestedPara = new HtmlElement("p", NULL, NULL, "nested para text");
$nestedDiv->addElement($nestedPara);
$mainDiv->addElement($nestedDiv);
for ($nestedDivCount = 0; $nestedDivCount < 15; $nestedDivCount++) {
    $newDiv = $nestedDiv->cloneMe();
    $nestedDiv->addElement($newDiv);
    $nestedDiv = $newDiv;
}
// create a set of hrefs to the paras
$linkDiv = new HtmlElement("div", array("class" => "linkDiv", "name" => "linkdivname"));
开发者ID:safrrhmn,项目名称:seleniumTestPages,代码行数:31,代码来源:find_by_playground.php

示例8: _createElement

 /**
  * Create element by tag setting array
  * 
  * @param array $setting
  * @return HtmlElement
  */
 protected static function _createElement($setting)
 {
     if (!isset($setting['tag_name'])) {
         throw new Exception('Specification of "tag_name" is required, but not specified.');
     }
     $elem = new HtmlElement($setting['tag_name']);
     if (isset($setting['attributes'])) {
         if (!is_array($setting['attributes'])) {
             throw new Exception('Specification of "attributes" in element setting must be an array, ' . gettype($setting['attributes']) . ' given.');
         }
         $elem->setAttributes($setting['attributes']);
     }
     if (isset($setting['is_empty'])) {
         $elem->setIsEmptyTag($setting['is_empty']);
     }
     if (isset($setting['nodes'])) {
         if ($elem->isEmptyTag()) {
             throw new Exception('Empty tag cannot contain node.');
         }
         if (!is_array($setting['nodes'])) {
             throw new Exception('Specification of "nodes" in element setting must be an array, ' . gettype($setting['nodes']) . ' given.');
         }
         foreach ($setting['nodes'] as $node) {
             if (is_array($node)) {
                 $subElem = self::_createElement($node);
                 $elem->addElement($subElem);
             } else {
                 $elem->addText($node);
             }
         }
     }
     if (isset($setting['text'])) {
         if ($elem->isEmptyTag()) {
             throw new Exception('Empty tag cannot contain node.');
         }
         if (is_array($setting['text']) || is_object($setting['text'])) {
             throw new Exception('Specification of "text" in element setting must be string, ' . gettype($setting['text']) . ' given.');
         }
         $elem->setText($setting['text']);
     }
     return $elem;
 }
开发者ID:2626suke,项目名称:curryfw,代码行数:48,代码来源:html_element.php


注:本文中的HtmlElement::addElement方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。