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


PHP HtmlElement::AddAttributes方法代碼示例

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


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

示例1: __construct

 /**
  * A widget for displaying an image (img)
  * @param string $imgurl The url of the image
  * @param string $alttext A text that will be shown if the image could not be loaded
  * @param boolean $forcehttps Specify if the link has to have https 
  * @param HtmlAttributes $args Allows custom html tag arguments to be specified (not recommended)
  **/
 public function __construct($imgurl = EMPTYSTRING, $alttext = '[IMG]', $args = null)
 {
     parent::__construct();
     $img = new HtmlElement('img', $args);
     $img->AddAttributes(array('src' => RTK::GetBaseURL() . $imgurl, 'alt' => $alttext));
     $this->AddChild($img);
 }
開發者ID:iensenfirippu,項目名稱:RTK,代碼行數:14,代碼來源:image.php

示例2: __construct

 /**
  * A widget for displaying a list of items
  * @param string[] $columnheaders The headers in the top row
  * @param boolean $alternaterow Determines if different styling should be applied to every other row
  * @param boolean $alternatecell Determines if different styling should be applied to every other cell
  * @param HtmlAttributes $args Allows custom html tag arguments to be specified (not recommended)
  **/
 public function __construct($columnheaders, $alternaterow = true, $alternatecell = false, $args = null)
 {
     parent::__construct();
     $table = new HtmlElement('div', array('class' => 'listview'), null, new HtmlElement('table'));
     $table->AddAttributes($args);
     $this->AddContainer($table, 'table');
     //$this->SetPointer('table');
     if ($alternaterow == false) {
         $this->_alternaterow = null;
     } else {
         $this->_alternaterow = true;
     }
     if ($alternatecell == false) {
         $this->_alternatecell = null;
     } else {
         $this->_alternatecell = true;
     }
     if (sizeof($columnheaders) > 0) {
         for ($i = 0; $i < sizeof($columnheaders); $i++) {
             $string = $columnheaders[$i];
             if (is_string($string) && strlen($string) > 0 && $string[0] == '_') {
                 $this->_compressedcols[] = $i;
                 $columnheaders[$i] = substr($columnheaders[$i], 1);
             }
         }
         $this->AddHeader($columnheaders);
     }
 }
開發者ID:iensenfirippu,項目名稱:RTK,代碼行數:35,代碼來源:listview.php

示例3: AddJavascript

 /**
  * Adds a javascript to the HTML document
  * @param string $filename The name of the file to add
  * @param HtmlAttributes $args Allows custom html tag arguments to be specified (not recommended)
  */
 public function AddJavascript($filename, $args = null)
 {
     $script = new HtmlElement('script', array('src' => $filename));
     $script->AddAttributes($args);
     $this->_javascripts[$filename] = $script;
 }
開發者ID:iensenfirippu,項目名稱:RTK,代碼行數:11,代碼來源:htmldocument.php


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