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


PHP FormElement::getName方法代码示例

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


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

示例1: _selectElements

 /**
  * Return an array with the elements according to the parameters
  *
  * @param int $id
  * @param int $langId
  * @param string $type
  *
  * @return array
  */
 protected function _selectElements($id, $all = false)
 {
     $oElem = new FormElement();
     $oElemType = new FormElementType();
     $select = $oElem->select()->setIntegrityCheck(false)->from($oElem->getName())->joinInner($oElemType->getName(), 'FET_ID = FE_TypeID', 'FET_Title');
     if (!$all) {
         $select->where('FE_ID = ?', $id);
     } else {
         $select->where('FE_SectionID = ?', $id);
     }
     $select->order('FE_Seq ASC');
     $elements = $oElem->fetchAll($select)->toArray();
     return $elements;
 }
开发者ID:anunay,项目名称:stentors,代码行数:23,代码来源:FormElementObject.php

示例2: process_form_elements

 public static function process_form_elements(FormElement $element)
 {
     ($element->getLabel() != null and $element->getLabel() != "") ? $isLabel = true : ($isLabel = false);
     ($element->getId() != null and $element->getId() != "") ? $label = $element->getId() : ($label = $element->getName());
     $output = "";
     // On case les checkbox / radio dans une div chez nous :)
     if (isset($element->getAttributes()['type'])) {
         if (!self::$flag_process_form_elements_radio_list_open) {
             if (!self::$flag_process_form_elements_checkbox_list_open and $element->getAttributes()['type'] == 'checkbox') {
                 self::$flag_process_form_elements_checkbox_list_open = true;
                 $output .= "<div style=\"float:left;\">";
             } else {
                 if (self::$flag_process_form_elements_checkbox_list_open and $element->getAttributes()['type'] != 'checkbox') {
                     self::$flag_process_form_elements_checkbox_list_open = false;
                     $output .= "</div><div style=\"clear:both;\"></div>";
                 }
             }
         }
         if (!self::$flag_process_form_elements_checkbox_list_open) {
             if (!self::$flag_process_form_elements_radio_list_open and $element->getAttributes()['type'] == 'radio') {
                 self::$flag_process_form_elements_radio_list_open = true;
                 $output .= "<div style=\"float:left;\">";
             } else {
                 if (self::$flag_process_form_elements_radio_list_open and $element->getAttributes()['type'] != 'radio') {
                     self::$flag_process_form_elements_radio_list_open = false;
                     $output .= "</div><div style=\"clear:both;\"></div>";
                 }
             }
         }
     } else {
         if (self::$flag_process_form_elements_radio_list_open or self::$flag_process_form_elements_checkbox_list_open) {
             self::$flag_process_form_elements_checkbox_list_open = false;
             self::$flag_process_form_elements_radio_list_open = false;
             $output .= "</div><div style=\"clear:both;\"></div>";
         }
     }
     // Element auto-fermable
     if ($element->is_closed()) {
         if ($isLabel and isset($element->getAttributes()['type']) and ($element->getAttributes()['type'] != 'radio' and $element->getAttributes()['type'] != 'checkbox')) {
             $output .= "<div class=\"formulaire_ligne\"><label for=\"" . $label . "\">" . $element->getLabel() . "</label>";
         }
         if (isset($element->getAttributes()['type']) and ($element->getAttributes()['type'] == 'checkbox' or $element->getAttributes()['type'] == 'radio')) {
             $output .= "<div class=\"FormElementCheckboxRadio\">";
         }
         $output .= "<" . $element->getBalise();
         if ($element->getId() != null and $element->getId() != "") {
             $output .= " id=\"" . $element->getId() . "\"";
         }
         if ($element->getName() != null and $element->getName() != "") {
             $output .= " name=\"" . $element->getName() . "\"";
         }
         $output .= " value=\"" . $element->getValue() . "\"";
         foreach ($element->getAttributes() as $k => $v) {
             $output .= " {$k}=\"{$v}\"";
             if ($k == 'type' and $v == 'radio') {
                 $output .= " class=\"radio\"";
             }
         }
         $output .= "/>";
         if ($isLabel and isset($element->getAttributes()['type']) and $element->getAttributes()['type'] == 'checkbox') {
             $output .= "<label for=\"" . $label . "\"><span class=\"ui\"></span><span class=\"label\">" . $element->getLabel() . "</span></label>";
             $output .= "</div>";
         } else {
             if ($isLabel and isset($element->getAttributes()['type']) and $element->getAttributes()['type'] == 'radio') {
                 $output .= "<label for=\"" . $label . "\"><span class=\"ui\"></span><span class=\"label\">" . $element->getLabel() . "</span></label>";
                 $output .= "</div>";
             } else {
                 if ($isLabel and isset($element->getAttributes()['type']) and ($element->getAttributes()['type'] != 'radio' and $element->getAttributes()['type'] != 'checkbox')) {
                     $output .= "</div>";
                 }
             }
         }
     } else {
         if ($isLabel and (strtolower($element->getBalise()) == "select" or strtolower($element->getBalise()) == "textarea")) {
             $output .= "<label for=\"" . $label . "\">" . $element->getLabel() . "</label>";
         }
         $output .= "<" . $element->getBalise();
         if ($element->getId() != null and $element->getId() != "") {
             $output .= " id=\"" . $element->getId() . "\"";
         }
         if ($element->getName() != null and $element->getName() != "") {
             $output .= " name=\"" . $element->getName() . "\"";
         }
         $output .= " value=\"" . $element->getValue() . "\"";
         foreach ($element->getAttributes() as $k => $v) {
             $output .= " {$k}=\"{$v}\"";
         }
         $output .= ">";
         if (sizeof($element->getElements()) > 0) {
             foreach ($element->getElements() as $v) {
                 $output .= self::process_form_elements($v);
             }
         } else {
             if (strtolower($element->getBalise()) != "textarea") {
                 $output .= $element->getLabel();
             } else {
                 $output .= $element->getValue();
             }
         }
         $output .= "</" . $element->getBalise() . ">";
//.........这里部分代码省略.........
开发者ID:decima,项目名称:M2-platine,代码行数:101,代码来源:Theme.php

示例3: addElement

 /**
  * add an element to the form
  * @param FormElement $element 
  * @return FormElement
  */
 private function addElement(FormElement $element)
 {
     return $this->_elements[$element->getName()] = $element;
 }
开发者ID:Suire,项目名称:erp-PPE2,代码行数:9,代码来源:form.php

示例4: renderFieldErrors

 /**
  * Renders a list of errors
  *
  * 
  * @param  FormElement  $field A form element
  */
 public function renderFieldErrors(FormElement $field)
 {
     // Strip brakets on field to fix problem with arrays.
     // this happens with the multi select elements
     $name = str_replace(array('[', ']'), array('', ''), $field->getName());
     if (isset($this->errors[$name]) && count($this->errors[$name])) {
         echo "<ul class=\"form_input_error\">";
         foreach ($this->errors[$name] as $error) {
             echo "<li>{$error}</li>";
         }
         echo "</ul>";
     }
 }
开发者ID:bachkoutou,项目名称:Simple-MVC,代码行数:19,代码来源:Form.php

示例5: process_form_elements

 public static function process_form_elements(FormElement $element)
 {
     ($element->getLabel() != null and $element->getLabel() != "") ? $isLabel = true : ($isLabel = false);
     ($element->getId() != null and $element->getId() != "") ? $label = $element->getId() : ($label = $element->getName());
     $output = "";
     // Element auto-fermable
     if ($element->is_closed()) {
         if ($isLabel and ($element->getAttributes()['type'] != 'radio' and $element->getAttributes()['type'] != 'checkbox')) {
             $output .= "<label for=\"" . $label . "\">" . $element->getLabel() . "</label>";
         }
         $output .= "<" . $element->getBalise();
         if ($element->getId() != null and $element->getId() != "") {
             $output .= " id=\"" . $element->getId() . "\"";
         }
         if ($element->getName() != null and $element->getName() != "") {
             $output .= " name=\"" . $element->getName() . "\"";
         }
         $output .= " value=\"" . $element->getValue() . "\"";
         foreach ($element->getAttributes() as $k => $v) {
             $output .= " {$k}=\"{$v}\"";
         }
         $output .= "/>";
         if ($isLabel and ($element->getAttributes()['type'] == 'radio' or $element->getAttributes()['type'] == 'checkbox')) {
             $output .= "<label for=\"" . $label . "\">" . $element->getLabel() . "</label>";
         }
     } else {
         if ($isLabel and (strtolower($element->getBalise()) == "select" or strtolower($element->getBalise()) == "textarea")) {
             $output .= "<label for=\"" . $label . "\">" . $element->getLabel() . "</label>";
         }
         $output .= "<" . $element->getBalise();
         if ($element->getId() != null and $element->getId() != "") {
             $output .= " id=\"" . $element->getId() . "\"";
         }
         if ($element->getName() != null and $element->getName() != "") {
             $output .= " name=\"" . $element->getName() . "\"";
         }
         $output .= " value=\"" . $element->getValue() . "\"";
         foreach ($element->getAttributes() as $k => $v) {
             $output .= " {$k}=\"{$v}\"";
         }
         $output .= ">";
         if (sizeof($element->getElements()) > 0) {
             foreach ($element->getElements() as $v) {
                 $output .= self::process_form_elements($v);
             }
         } else {
             if (strtolower($element->getBalise()) != "textarea") {
                 $output .= $element->getLabel();
             } else {
                 $output .= $element->getValue();
             }
         }
         $output .= "</" . $element->getBalise() . ">";
     }
     return $output;
 }
开发者ID:decima,项目名称:M2-platine,代码行数:56,代码来源:Themed.php


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