当前位置: 首页>>代码示例>>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;未经允许,请勿转载。