本文整理汇总了PHP中BaseForm::getDefaultParishID方法的典型用法代码示例。如果您正苦于以下问题:PHP BaseForm::getDefaultParishID方法的具体用法?PHP BaseForm::getDefaultParishID怎么用?PHP BaseForm::getDefaultParishID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseForm
的用法示例。
在下文中一共展示了BaseForm::getDefaultParishID方法的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;
}