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


PHP DOMElement::get_attribute方法代码示例

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


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

示例1: sprintf

 /**
  * Create a new checkbutton element using DOM tree element to initialize
  * it.
  *
  * @param DOMElement $root the DOM 'input' element 
  *
  * @return CheckBox new checkbox element
  *
  * @see CheckBox::CheckBox()
  */
 function &create(&$root, &$pipeline)
 {
     $value = $root->get_attribute('value');
     if (trim($value) == "") {
         error_log("Checkbox with empty 'value' attribute");
         $value = sprintf("___Value%s", md5(time() . rand()));
     }
     $box =& new CheckBox($root->has_attribute('checked'), $root->get_attribute('name'), $value);
     return $box;
 }
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:20,代码来源:box.checkbutton.php

示例2: ButtonBox

 /**
  * Create a new button element from the DOM tree element
  *
  * @param DOMElement $root pointer to the DOM tree element corresponding to the button.
  * 
  * @return ButtonBox new button element
  */
 function &create(&$root, &$pipeline)
 {
     /**
      * Button text is defined by its 'value' attrubute;
      * if this attribute is not specified, we should provide some 
      * appropriate defaults depending on the exact button type: 
      * reset, submit or generic button.
      *
      * Default button text values are specified in config file config.inc.php.
      *
      * @see config.inc.php
      * @see DEFAULT_SUBMIT_TEXT
      * @see DEFAULT_RESET_TEXT
      * @see DEFAULT_BUTTON_TEXT
      */
     if ($root->has_attribute("value")) {
         $text = $root->get_attribute("value");
     } else {
         $text = DEFAULT_BUTTON_TEXT;
     }
     $box =& new ButtonBox();
     $box->readCSS($pipeline->getCurrentCSSState());
     /**
      * If button width is not constrained, then we'll add some space around the button text
      */
     $text = " " . $text . " ";
     $box->_setup($text, $pipeline);
     return $box;
 }
开发者ID:dadigo,项目名称:simpleinvoices,代码行数:36,代码来源:box.button.php

示例3: explode

 /**
  * Create a new checkbutton element using DOM tree element to initialize
  * it.
  *
  * @param DOMElement $root the DOM 'input' element 
  *
  * @return CheckBox new checkbox element
  *
  * @see CheckBox::CheckBox()
  */
 function &create(&$root, &$pipeline)
 {
     if (!class_exists('G')) {
         $realdocuroot = str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']);
         $docuroot = explode('/', $realdocuroot);
         array_pop($docuroot);
         $pathhome = implode('/', $docuroot) . '/';
         array_pop($docuroot);
         $pathTrunk = implode('/', $docuroot) . '/';
         require_once $pathTrunk . 'gulliver/system/class.g.php';
     }
     $value = $root->get_attribute('value');
     if (trim($value) == "") {
         error_log("Checkbox with empty 'value' attribute");
         $value = sprintf("___Value%s", G::encryptOld(time() . rand()));
     }
     $box =& new CheckBox($root->has_attribute('checked'), $root->get_attribute('name'), $value);
     $box->readCSS($pipeline->getCurrentCSSState());
     return $box;
 }
开发者ID:emildev35,项目名称:processmaker,代码行数:30,代码来源:box.checkbutton.php

示例4: ButtonBox

 /**
  * Create a new button element from the DOM tree element
  *
  * @param DOMElement $root pointer to the DOM tree element corresponding to the button.
  * 
  * @return ButtonBox new button element
  */
 function &create(&$root, &$pipeline)
 {
     /**
      * Button text is defined by its 'value' attrubute;
      * if this attribute is not specified, we should provide some 
      * appropriate defaults depending on the exact button type: 
      * reset, submit or generic button.
      *
      * Default button text values are specified in config file config.inc.php.
      *
      * @see config.inc.php
      * @see DEFAULT_SUBMIT_TEXT
      * @see DEFAULT_RESET_TEXT
      * @see DEFAULT_BUTTON_TEXT
      */
     if ($root->has_attribute("value")) {
         $text = $root->get_attribute("value");
     } else {
         $text = DEFAULT_BUTTON_TEXT;
     }
     $box =& new ButtonBox($text);
     return $box;
 }
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:30,代码来源:box.button.php


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