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


PHP HiddenField::setForm方法代码示例

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


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

示例1: setForm

 public function setForm($form)
 {
     parent::setForm($form);
     $this->dateField->setForm($form);
     $this->timeField->setForm($form);
     $this->timezoneField->setForm($form);
     return $this;
 }
开发者ID:jacobbuck,项目名称:silverstripe-framework,代码行数:8,代码来源:DatetimeField.php

示例2: Field

 public function Field($properties = array())
 {
     $titleArray = $itemIDs = array();
     $titleList = $itemIDsList = "";
     if ($items = $this->getItems()) {
         foreach ($items as $item) {
             $titleArray[] = $item->Title;
         }
         foreach ($items as $item) {
             $itemIDs[] = $item->ID;
         }
         if ($titleArray) {
             $titleList = implode(", ", $titleArray);
         }
         if ($itemIDs) {
             $itemIDsList = implode(",", $itemIDs);
         }
     }
     $field = new ReadonlyField($this->name . '_ReadonlyValue', $this->title);
     $field->setValue($titleList);
     $field->setForm($this->form);
     $valueField = new HiddenField($this->name);
     $valueField->setValue($itemIDsList);
     $valueField->setForm($this->form);
     return $field->Field() . $valueField->Field();
 }
开发者ID:SpiritLevel,项目名称:silverstripe-framework,代码行数:26,代码来源:TreeMultiselectField_Readonly.php

示例3: getExtraFields

 /**
  * Generate extra special fields - namely the security token field (if required).
  * 
  * @return FieldList
  */
 public function getExtraFields()
 {
     $extraFields = new FieldList();
     $token = $this->getSecurityToken();
     $tokenField = $token->updateFieldSet($this->fields);
     if ($tokenField) {
         $tokenField->setForm($this);
     }
     $this->securityTokenAdded = true;
     // add the "real" HTTP method if necessary (for PUT, DELETE and HEAD)
     if ($this->FormMethod() != $this->FormHttpMethod()) {
         $methodField = new HiddenField('_method', '', $this->FormHttpMethod());
         $methodField->setForm($this);
         $extraFields->push($methodField);
     }
     return $extraFields;
 }
开发者ID:prostart,项目名称:erics-homes,代码行数:22,代码来源:Form.php

示例4: getExtraFields

	/**
	 * Generate extra special fields - namely the SecurityID field
	 * 
	 * @return FieldSet
	 */
	public function getExtraFields() {
		$extraFields = new FieldSet();
		
		if(!$this->fields->fieldByName('SecurityID') && $this->securityTokenEnabled()) {
			if(Session::get('SecurityID')) {
				$securityID = Session::get('SecurityID');
			} else {
				$securityID = rand();
				Session::set('SecurityID', $securityID);
			}
			
			$securityField = new HiddenField('SecurityID', '', $securityID);
			$securityField->setForm($this);
			$extraFields->push($securityField);
			$this->securityTokenAdded = true;
		}
		
		// add the "real" HTTP method if necessary (for PUT, DELETE and HEAD)
		if($this->FormMethod() != $this->FormHttpMethod()) {
			$methodField = new HiddenField('_method', '', $this->FormHttpMethod());
			$methodField->setForm($this);
			$extraFields->push($methodField);
		}
		
		return $extraFields;
	}
开发者ID:neopba,项目名称:silverstripe-book,代码行数:31,代码来源:Form.php

示例5: getColumnContent

 public function getColumnContent($grid, $record, $col)
 {
     // In case you are using GridFieldEditableColumns, this ensures that
     // the correct sort order is saved. If you are not using that component,
     // this will be ignored by other components, but will still work for this.
     $sortFieldName = sprintf('%s[GridFieldEditableColumns][%s][%s]', $grid->getName(), $record->ID, $this->getSortField());
     $sortField = new HiddenField($sortFieldName, false, $record->getField($this->getSortField()));
     $sortField->addExtraClass('ss-orderable-hidden-sort');
     $sortField->setForm($grid->getForm());
     return ViewableData::create()->customise(array('SortField' => $sortField))->renderWith('GridFieldOrderableRowsDragHandle');
 }
开发者ID:ajshort,项目名称:silverstripe-gridfieldextensions,代码行数:11,代码来源:GridFieldOrderableRows.php


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