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


PHP Field::Field方法代码示例

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


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

示例1: TextArea

 /**
  * TextArea::TextArea()
  *
  * Constructor: create a new textarea
  *
  * @param object &$oForm: The form where this field is located on
  * @param string $sName: The name of the field
  * @return TextArea
  * @author Teye Heimans
  * @access public
  */
 function TextArea(&$oform, $sName)
 {
     // call the constructor of the Field class
     parent::Field($oform, $sName);
     $this->setCols(40);
     $this->setRows(7);
 }
开发者ID:jwiegel,项目名称:FormHandler,代码行数:18,代码来源:class.TextArea.php

示例2: TextField

 /**
  * TextField::TextField()
  *
  * Constructor: Create a new textfield object
  *
  * @param object &$oForm: The form where this field is located on
  * @param string $sName: The name of the field
  * @return TextField
  * @author Teye Heimans
  * @access public
  */
 function TextField(&$oForm, $sName)
 {
     // call the constructor of the Field class
     parent::Field($oForm, $sName);
     $this->setSize(20);
     $this->setMaxlength(0);
 }
开发者ID:jwiegel,项目名称:FormHandler,代码行数:18,代码来源:class.TextField.php

示例3: SelectField

 /**
  * SelectField::SelectField()
  *
  * Public constructor: Create a selectfield object
  *
  * @param object $oForm: The form where the field is located on
  * @param string $sName: The name of the form
  * @return SelectField
  * @access public
  * @author Teye Heimans
  */
 function SelectField(&$oForm, $sName)
 {
     // call the constructor of the Field class
     parent::Field($oForm, $sName);
     $this->setSize(1);
     $this->useArrayKeyAsValue(FH_DEFAULT_USEARRAYKEY);
     $this->setMultiple(false);
 }
开发者ID:jwiegel,项目名称:FormHandler,代码行数:19,代码来源:class.SelectField.php

示例4: RadioButton

 /**
  * RadioButton::RadioButton()
  *
  * Constructor: Create a new radiobutton object
  *
  * @param object $oForm: The form where this field is located on
  * @param string $sName: The name of the field
  * @param array|string $aOptions: The options for the field
  * @return RadioButton
  * @author Teye Heimans
  */
 function RadioButton(&$oForm, $sName, $aOptions)
 {
     // call the constructor of the Field class
     parent::Field($oForm, $sName);
     $this->_aOptions = $aOptions;
     $this->setMask(FH_DEFAULT_GLUE_MASK);
     $this->useArrayKeyAsValue(FH_DEFAULT_USEARRAYKEY);
 }
开发者ID:jwiegel,项目名称:FormHandler,代码行数:19,代码来源:class.RadioButton.php

示例5: CheckBox

 /**
  * CheckBox::CheckBox()
  *
  * Constructor: Create a new checkbox object
  *
  * @param object $oForm: The form where this field is located on
  * @param string $sName: The name of the field
  * @param mixed: array|string $aOptions - The options for the field
  * @return CheckBox
  * @access public
  * @author Teye Heimans
  */
 function CheckBox(&$oForm, $sName, $aOptions)
 {
     $this->_mValue = '';
     $sName = str_replace('[]', '', $sName);
     $this->_aOptions = $aOptions;
     // call the constructor of the Field class
     parent::Field($oForm, $sName);
     $this->setMask(FH_DEFAULT_GLUE_MASK);
     $this->useArrayKeyAsValue(FH_DEFAULT_USEARRAYKEY);
 }
开发者ID:jwiegel,项目名称:FormHandler,代码行数:22,代码来源:class.CheckBox.php

示例6: while

 /**
  * class constructor
  */
 function Field_Country($id_common)
 {
     parent::Field($id_common);
     $query_tax_country = "\r\n\t\tSELECT id_country, name_country\r\n\t\tFROM " . $this->getCountryTable() . "\r\n\t\tORDER BY name_country";
     $re_field_element = sql_query($query_tax_country);
     $this->_options[0] = '';
     while (list($id_common_son, $element) = sql_fetch_row($re_field_element)) {
         $this->_options[$id_common_son] = $this->convert_name($element);
     }
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:13,代码来源:class.country.php

示例7: BrowserField

 /**
  * TextField::BrowserField()
  *
  * Constructor: Create a new textfield object
  *
  * @param object &$oForm: The form where this field is located on
  * @param string $sName: The name of the field
  * @param string $sPath: The path to browse
  * @return BrowserField
  * @author Johan Wiegel
  * @access public
  */
 function BrowserField(&$oForm, $sName, $sPath)
 {
     // call the constructor of the Field class
     parent::Field($oForm, $sName);
     $this->_path = $sPath;
     $this->_form = $oForm;
     $this->setSize(20);
     $bSetJS = true;
     $oForm->_setJS('function SetUrl( sUrl, sName ){document.getElementById( sName ).value=sUrl}', $isFile = false, $before = true);
 }
开发者ID:reshadf,项目名称:RMProject,代码行数:22,代码来源:class.BrowserField.php

示例8: TimeField

 /**
  * TimeField::TimeField()
  *
  * Constructor: create a new TimeField on the given form
  *
  * @param object $oForm: The form where the field is located on
  * @param string $sName: The name of the field
  * @return TimeField
  * @author Teye Heimans
  */
 function TimeField(&$oForm, $sName)
 {
     // set the default hour format
     $this->setHourFormat(FH_TIMEFIELD_DEFAULT_HOUR_FORMAT);
     // set if the field is required
     $this->setRequired(FH_TIMEFIELD_DEFAULT_REQUIRED);
     // make the hour and minute fields
     $this->_oHour = new SelectField($oForm, $sName . '_hour');
     $this->_oMinute = new SelectField($oForm, $sName . '_minute');
     parent::Field($oForm, $sName);
     // posted or edit form? Then load the value of the time
     if ($oForm->isPosted() || isset($oForm->edit) && $oForm->edit) {
         $this->_mValue = $this->_oHour->getValue() . ':' . $this->_oMinute->getValue();
     }
 }
开发者ID:reshadf,项目名称:RMProject,代码行数:25,代码来源:class.TimeField.php

示例9: Editor

 /**
  * Editor::Editor()
  *
  * Constructor: create a new Editor object
  *
  * @param object $oForm: The form where the field is located on
  * @return Editor
  * @access public
  * @author Teye Heimans
  */
 function Editor(&$oForm, $sName)
 {
     $this->_oEditor = new ckeditor($sName);
     $this->_oEditor->returnOutput = true;
     $this->_oEditor->basePath = FH_FHTML_DIR . 'ckeditor/';
     //   added as workarround IE9
     $this->_oEditor->Value = isset($this->_mValue) ? $this->_mValue : '';
     $this->setToolbar('Default');
     // Default or Basic
     $this->setServerPath('');
     parent::Field($oForm, $sName);
     // set the language
     $this->_oEditor->config['language'] = str_replace('-utf8', '', $oForm->_lang);
     // default height & width
     $this->setWidth(720);
     $this->setHeight(400);
     // default, silver or office2003
     $this->setSkin('v2');
 }
开发者ID:reshadf,项目名称:RMProject,代码行数:29,代码来源:class.Editor.php

示例10: ListField

 /**
  * ListField::ListField()
  *
  * Constructor: Create a new ListField
  *
  * @param object &$oForm: The form where this field is located on
  * @param string $sName: The name of the field
  * @param array  $aOptions: The options of the field
  * @return ListField
  * @access public
  * @author Teye Heimans
  */
 function ListField(&$oForm, $sName, $aOptions)
 {
     $this->_mValue = array();
     static $bSetJS = false;
     // needed javascript included yet ?
     if (!$bSetJS) {
         $bSetJS = true;
         $oForm->_setJS(FH_FHTML_DIR . "js/listfield.js", true);
     }
     // set the options
     $this->_aOptions = $aOptions;
     parent::Field($oForm, $sName, $aOptions);
     // make the fields of the listfield
     $this->_oHidden = new HiddenField($oForm, $sName);
     $this->_oOn = new SelectField($oForm, $sName . '_ListOn');
     $this->_oOff = new SelectField($oForm, $sName . '_ListOff');
     $this->_oOn->setMultiple(true);
     $this->_oOff->setMultiple(true);
     // set some default values
     $this->useArrayKeyAsValue(FH_DEFAULT_USEARRAYKEY);
     $this->setSize(FH_DEFAULT_LISTFIELD_SIZE);
     $this->setOffTitle($oForm->_text(29));
     $this->setOnTitle($oForm->_text(30));
 }
开发者ID:reshadf,项目名称:RMProject,代码行数:36,代码来源:class.ListField.php

示例11:

 /**
  * class constructor
  */
 function Field_Freetext($id_common)
 {
     parent::Field($id_common);
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:7,代码来源:class.freetext.php

示例12: DateField

 /**
  * DateField::DateField()
  *
  * Constructor: create a new datefield object
  *
  * @param object &$oForm: the form where the datefield is located on
  * @param string $sName: the name of the datefield
  * @param string $sMask: the mask which is used to display the fields
  * @return DateField
  * @access public
  * @author Teye Heimans
  */
 function DateField(&$oForm, $sName, $sMask = null, $bRequired = null, $sInterval = null)
 {
     // set the default date display
     $this->setMask(!is_null($sMask) ? $sMask : FH_DATEFIELD_DEFAULT_DISPLAY);
     // set the default interval
     $this->setInterval(!is_null($sInterval) ? $sInterval : FH_DATEFIELD_DEFAULT_DATE_INTERVAL);
     // set if the field is required
     $this->setRequired(!is_null($bRequired) ? $bRequired : FH_DATEFIELD_DEFAULT_REQUIRED);
     // d = selectfield day
     // m = selectfield month
     // y = selectfield year
     // D = textfield day
     // M = textfield month
     // Y = textfield year
     // generate the objects for the fields
     $fields = $this->_getFieldsFromMask();
     $len = strlen($fields);
     for ($x = 0; $x < $len; $x++) {
         $c = $fields[$x];
         switch ($c) {
             // year selectfield
             case 'y':
                 $this->_oYear = new SelectField($oForm, $sName . '_year');
                 // get the year interval
                 list($iStart, $iEnd) = $this->_getYearInterval();
                 $iEnd = intval($iEnd);
                 $iStart = intval($iStart);
                 $iYear = date('Y');
                 // set the years
                 $aYears = array();
                 if (!$bRequired) {
                     $aYears[''] = '';
                 }
                 // was 0000
                 // calculate the difference between the years
                 $iDiff = $iYear + $iEnd - ($iYear - $iStart);
                 $iCounter = 0;
                 while ($iDiff != $iCounter) {
                     $i = $iYear + $iEnd - $iCounter;
                     $aYears[$i] = $i;
                     $iCounter += $iCounter < $iDiff ? 1 : -1;
                 }
                 // set the options
                 $this->_oYear->setOptions($aYears);
                 break;
                 // year textfield
             // year textfield
             case 'Y':
                 $this->_oYear = new TextField($oForm, $sName . '_year');
                 $this->_oYear->setSize(4);
                 $this->_oYear->setMaxlength(4);
                 $this->_oYear->setValidator(_FH_DIGIT);
                 break;
                 // month selectfield
             // month selectfield
             case 'm':
                 $this->_oMonth = new SelectField($oForm, $sName . '_month');
                 // set the months in the field
                 $aMonths = array('01' => $oForm->_text(1), '02' => $oForm->_text(2), '03' => $oForm->_text(3), '04' => $oForm->_text(4), '05' => $oForm->_text(5), '06' => $oForm->_text(6), '07' => $oForm->_text(7), '08' => $oForm->_text(8), '09' => $oForm->_text(9), '10' => $oForm->_text(10), '11' => $oForm->_text(11), '12' => $oForm->_text(12));
                 if (!$bRequired) {
                     $aMonths[''] = '';
                     // was 00
                     ksort($aMonths);
                 }
                 // set the options
                 $this->_oMonth->setOptions($aMonths);
                 break;
                 // month textfield
             // month textfield
             case 'M':
                 $this->_oMonth = new TextField($oForm, $sName . '_month');
                 $this->_oMonth->setSize(2);
                 $this->_oMonth->setMaxlength(2);
                 $this->_oMonth->setValidator(_FH_DIGIT);
                 break;
                 // day selectfield
             // day selectfield
             case 'd':
                 $this->_oDay = new SelectField($oForm, $sName . '_day');
                 // get the days
                 $aDays = array();
                 if (!$bRequired) {
                     $aDays[''] = '';
                 }
                 // was 00
                 for ($i = 1; $i <= 31; $i++) {
                     $aDays[sprintf('%02d', $i)] = sprintf('%02d', $i);
                 }
//.........这里部分代码省略.........
开发者ID:jwiegel,项目名称:FormHandler,代码行数:101,代码来源:class.DateField.php

示例13: TextField

 function TextField($name, $label, $default)
 {
     parent::Field($name, $label, 'text', $default);
 }
开发者ID:tejdeeps,项目名称:tejcs.com,代码行数:4,代码来源:TextField.php

示例14:

 /**
  * class constructor
  */
 function Field_Upload($id_common)
 {
     parent::Field($id_common);
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:7,代码来源:class.upload.php

示例15:

 /**
  * class constructor
  */
 function Field_Cf($id_common)
 {
     parent::Field($id_common);
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:7,代码来源:class.cf.php


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