當前位置: 首頁>>代碼示例>>PHP>>正文


PHP BaseForm::getFormFields方法代碼示例

本文整理匯總了PHP中BaseForm::getFormFields方法的典型用法代碼示例。如果您正苦於以下問題:PHP BaseForm::getFormFields方法的具體用法?PHP BaseForm::getFormFields怎麽用?PHP BaseForm::getFormFields使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在BaseForm的用法示例。


在下文中一共展示了BaseForm::getFormFields方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getFormFields

 public function getFormFields()
 {
     $fields = parent::getFormFields();
     /*
             'Status' => "Enum('own, rent, loan')",
             'Amount' => 'Int',
             'HoldsRationCard' => 'Boolean',
             'CardType' => 'VarChar(4)',
             'Type' => "Enum('hut,ollapera,sheet,oddapera,concrete,2level,multilevel,flat')",
             'BuildYear' => 'Int'
     */
     $statusArray = singleton('House')->dbObject('Status')->enumValues();
     $statusField = DropdownField::create('Status', 'Own House/Renting/On Loan', $statusArray);
     $statusField->setEmptyString('All');
     $fields->push($statusField);
     //$fields->push(CheckboxField::create('HoldsRationCard', 'Yes'));
     $options = array('1' => 'Yes', '0' => 'No', '' => 'All');
     $holdsRationCardField = new OptionsetField("HoldsRationCard", 'Holds RationCard', $options, null);
     $fields->push($holdsRationCardField);
     $cardTypes = Config::inst()->get('House', 'CardType');
     $cardTypeField = DropdownField::create('CardType', 'Ration Card Type', $cardTypes);
     $cardTypeField->setEmptyString('select any');
     $fields->push($cardTypeField);
     $typeArray = singleton('House')->dbObject('Type')->enumValues();
     $typeField = DropdownField::create('Type', 'House Type', $typeArray);
     $typeField->setEmptyString('select any');
     $fields->push($typeField);
     $parishes = Parish::get()->map('ID', 'NameWithLocation')->toArray();
     $parishField = DropdownField::create('ParishID', 'Parish')->setSource($parishes);
     $parishField->setEmptyString('All Parish');
     $parishField->setValue(parent::getDefaultParishID());
     $fields->push($parishField);
     return $fields;
 }
開發者ID:thomaspaulson,項目名稱:myparish,代碼行數:34,代碼來源:HouseSearchForm.php

示例2: getFormFields

 public function getFormFields()
 {
     $fields = parent::getFormFields();
     $typeArray = singleton('Agriculture')->dbObject('Type')->enumValues();
     $typeField = DropdownField::create('Type', 'Type', $typeArray);
     $typeField->setEmptyString('select any');
     $fields->push($typeField);
     $parishes = Parish::get()->map('ID', 'NameWithLocation')->toArray();
     $parishField = DropdownField::create('ParishID', 'Parish')->setSource($parishes);
     $parishField->setEmptyString('All Parish');
     $parishField->setValue(parent::getDefaultParishID());
     $fields->push($parishField);
     return $fields;
 }
開發者ID:thomaspaulson,項目名稱:myparish,代碼行數:14,代碼來源:AgricultureSearchForm.php

示例3: getFormFields

 public function getFormFields()
 {
     $fields = parent::getFormFields();
     $options = array('1' => 'Yes', '0' => 'No', '' => 'All');
     $statusField = new OptionsetField("Status", 'Shifted from Urban/Rural area', $options, 1);
     $fields->push($statusField);
     //$fields->push(CheckboxField::create('Status', 'Yes'));
     $parishes = Parish::get()->map('ID', 'NameWithLocation')->toArray();
     $parishField = DropdownField::create('ParishID', 'Parish')->setSource($parishes);
     $parishField->setEmptyString('All Parish');
     $parishField->setValue(parent::getDefaultParishID());
     $fields->push($parishField);
     return $fields;
 }
開發者ID:thomaspaulson,項目名稱:myparish,代碼行數:14,代碼來源:ShiftedFromSearchForm.php

示例4: getFormFields

 public function getFormFields()
 {
     $fields = parent::getFormFields();
     //$fields->push(TextField::create('Pincode', 'Pincode'));
     $fields->push(TextField::create('BlockNo', 'Block No'));
     $fields->push(TextField::create('UnitNo', 'Unit No'));
     //$fields->push(CheckboxField::create('IsPanchayat', 'Is Panchayat'));
     //$fields->push(CheckboxField::create('IsMunicipality', 'Is Municipality'));
     //$fields->push(CheckboxField::create('IsCorporation', 'Is Corporation'));
     $parishes = Parish::get()->map('ID', 'NameWithLocation')->toArray();
     $parishField = DropdownField::create('ParishID', 'Parish')->setSource($parishes);
     $parishField->setEmptyString('All Parish');
     $parishField->setValue(parent::getDefaultParishID());
     $fields->push($parishField);
     return $fields;
 }
開發者ID:thomaspaulson,項目名稱:myparish,代碼行數:16,代碼來源:ParishSearchForm.php

示例5: getFormFields

 public function getFormFields()
 {
     $fields = parent::getFormFields();
     //$fields->push(CheckboxField::create('HoldsLand', 'Yes'));
     $options = array('1' => 'Yes', '0' => 'No', '' => 'All');
     $holdsLandField = new OptionsetField("HoldsLand", 'Holds Land', $options, null);
     $fields->push($holdsLandField);
     $landArray = singleton('Land')->dbObject('Area')->enumValues();
     $landField = DropdownField::create('Area', 'Area', $landArray);
     $landField->setEmptyString('select any');
     $fields->push($landField);
     $parishes = Parish::get()->map('ID', 'NameWithLocation')->toArray();
     $parishField = DropdownField::create('ParishID', 'Parish')->setSource($parishes);
     $parishField->setEmptyString('All Parish');
     $parishField->setValue(parent::getDefaultParishID());
     $fields->push($parishField);
     return $fields;
 }
開發者ID:thomaspaulson,項目名稱:myparish,代碼行數:18,代碼來源:LandSearchForm.php


注:本文中的BaseForm::getFormFields方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。