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


PHP HiddenField::getField方法代码示例

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


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

示例1: reset

 /**
  * FormHandler::_getForm()
  *
  * Private: get the form
  *
  * @return string: the generated form
  * @access public
  * @author Teye Heimans
  */
 function _getForm($iDisplayPage = null)
 {
     // is no specific page requested, then get the "current" page
     if (is_null($iDisplayPage)) {
         $iDisplayPage = $this->_curPage;
     }
     // make sure that the requested page cannot be negative
     if ($iDisplayPage <= 0) {
         $iDisplayPage = 1;
     }
     // set the tab indexes for the fields...
     reset($this->_tabindexes);
     ksort($this->_tabindexes);
     while (list($index, $field) = each($this->_tabindexes)) {
         // check if the field exists in the form ?
         if ($this->fieldExists($field)) {
             // set the tab index
             $this->_fields[$field][1]->setTabIndex($index);
         } else {
             trigger_error('Error, try to set the tabindex of an unknown field "' . $field . '"!', E_USER_NOTICE);
         }
     }
     // set the focus to the first (tab index) field if no focus is set yet
     if (is_null($this->_focus)) {
         // are there tab indexes set ?
         if (sizeof($this->_tabindexes) > 0) {
             // set the focus to the element with the lowest positive tab index
             reset($this->_tabindexes);
             while (list($key, $field) = each($this->_tabindexes)) {
                 if ($key >= 0 && $this->setFocus($field)) {
                     break;
                 }
             }
         }
         // no focus set yet. Set the focus to the first field
         if (is_null($this->_focus)) {
             // is it a object (only fields + buttons are objects)
             foreach ($this->_fields as $name => $data) {
                 if (is_object($this->_fields[$name][1]) && $this->setFocus($name)) {
                     break;
                 }
             }
         }
     }
     // initialize the used vars
     $hidden = '';
     $form = '';
     $buffer = array();
     $repeat = true;
     $page = 1;
     // start a new mask loader
     $mask = new MaskLoader();
     // set the seach values
     $mask->setSearch(array('/%field%/', '/%error%/', '/%title%/', '/%seperator%/', '/%name%/', '/%error_id%/', '/%value%/', '/%help%/'));
     // walk trought the fields array
     foreach ($this->_fields as $id => $field) {
         switch ($field[0]) {
             // multiple pages in this form
             case '__PAGE__':
                 # why did we stop at the current page ?
                 //if( $field[1] == $iDisplayPage)
                 //{
                 //    break;
                 //}
                 $page++;
                 break;
                 // hidden field
             // hidden field
             case '__HIDDEN__':
                 $hidden .= $field[1]->getField() . "\n";
                 $hidden .= $field[1]->getError() . "\n";
                 break;
                 // new mask to set
             // new mask to set
             case '__MASK__':
                 if (!isset($this->_mask) || is_null($this->_mask) || $page == $iDisplayPage) {
                     list($this->_mask, $repeat) = $field[1];
                 }
                 break;
                 // insert html or a line
             // insert html or a line
             case '__HTML__':
             case '__LINE__':
                 // but only if the html or line is on this page!
                 if ($page == $iDisplayPage) {
                     $form .= $field[1];
                 }
                 break;
                 // begin new fieldset
             // begin new fieldset
             case '__FIELDSET__':
//.........这里部分代码省略.........
开发者ID:jwiegel,项目名称:FormHandler,代码行数:101,代码来源:class.FormHandler.php


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