本文整理匯總了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}