當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。