本文整理汇总了PHP中TextField::setForm方法的典型用法代码示例。如果您正苦于以下问题:PHP TextField::setForm方法的具体用法?PHP TextField::setForm怎么用?PHP TextField::setForm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextField
的用法示例。
在下文中一共展示了TextField::setForm方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setForm
public function setForm($form)
{
parent::setForm($form);
if (isset($this->fileField)) {
$this->fileField->setForm($form);
}
if (isset($this->internalField)) {
$this->internalField->setForm($form);
}
}
示例2: updateFormFields
/**
* Updates the form fields for address'es to use a dropdown for the state and an additional field for the other state
* @param {FieldList} $fields Fields to modify
*/
public function updateFormFields(FieldList $fields)
{
$stateField = $fields->dataFieldByName('State');
if ($stateField) {
$newStateField = new GroupedDropdownField('State', $stateField->Title, array(_t('FedExStateProvinceExtension.UNITED_STATES', '_United States') => array('AL' => _t('FedExStateProvinceExtension.US_AL', '_Alabama'), 'LA' => _t('FedExStateProvinceExtension.US_LA', '_Louisiana'), 'OK' => _t('FedExStateProvinceExtension.US_OK', '_Oklahoma'), 'AK' => _t('FedExStateProvinceExtension.US_AK', '_Alaska'), 'ME' => _t('FedExStateProvinceExtension.US_ME', '_Maine'), 'OR' => _t('FedExStateProvinceExtension.US_OR', '_Oregon'), 'AZ' => _t('FedExStateProvinceExtension.US_AZ', '_Arizona'), 'MD' => _t('FedExStateProvinceExtension.US_MD', '_Maryland'), 'PA' => _t('FedExStateProvinceExtension.US_PA', '_Pennsylvania'), 'AR' => _t('FedExStateProvinceExtension.US_AR', '_Arkansas'), 'MA' => _t('FedExStateProvinceExtension.US_MA', '_Massachusetts'), 'RI' => _t('FedExStateProvinceExtension.US_RI', '_Rhode Island'), 'CA' => _t('FedExStateProvinceExtension.US_CA', '_California'), 'MI' => _t('FedExStateProvinceExtension.US_MI', '_Michigan'), 'SC' => _t('FedExStateProvinceExtension.US_SC', '_South Carolina'), 'CO' => _t('FedExStateProvinceExtension.US_CO', '_Colorado'), 'MN' => _t('FedExStateProvinceExtension.US_MN', '_Minnesota'), 'SD' => _t('FedExStateProvinceExtension.US_SD', '_South Dakota'), 'CT' => _t('FedExStateProvinceExtension.US_CT', '_Connecticut'), 'MS' => _t('FedExStateProvinceExtension.US_MS', '_Mississippi'), 'TN' => _t('FedExStateProvinceExtension.US_TN', '_Tennessee'), 'DE' => _t('FedExStateProvinceExtension.US_DE', '_Delaware'), 'MO' => _t('FedExStateProvinceExtension.US_MO', '_Missouri'), 'TX' => _t('FedExStateProvinceExtension.US_TX', '_Texas'), 'DC' => _t('FedExStateProvinceExtension.US_DC', '_District of Columbia'), 'MT' => _t('FedExStateProvinceExtension.US_MT', '_Montana'), 'UT' => _t('FedExStateProvinceExtension.US_UT', '_Utah'), 'FL' => _t('FedExStateProvinceExtension.US_FL', '_Florida'), 'NE' => _t('FedExStateProvinceExtension.US_NE', '_Nebraska'), 'VT' => _t('FedExStateProvinceExtension.US_VT', '_Vermont'), 'GA' => _t('FedExStateProvinceExtension.US_GA', '_Georgia'), 'NV' => _t('FedExStateProvinceExtension.US_NV', '_Nevada'), 'VA' => _t('FedExStateProvinceExtension.US_VA', '_Virginia'), 'HI' => _t('FedExStateProvinceExtension.US_HI', '_Hawaii'), 'NH' => _t('FedExStateProvinceExtension.US_NH', '_New Hampshire'), 'WA' => _t('FedExStateProvinceExtension.US_WA', '_Washington State'), 'ID' => _t('FedExStateProvinceExtension.US_ID', '_Idaho'), 'NJ' => _t('FedExStateProvinceExtension.US_NJ', '_New Jersey'), 'WV' => _t('FedExStateProvinceExtension.US_WV', '_West Virginia'), 'IL' => _t('FedExStateProvinceExtension.US_IL', '_Illinois'), 'NM' => _t('FedExStateProvinceExtension.US_NM', '_New Mexico'), 'WI' => _t('FedExStateProvinceExtension.US_WI', '_Wisconsin'), 'IN' => _t('FedExStateProvinceExtension.US_IN', '_Indiana'), 'NY' => _t('FedExStateProvinceExtension.US_NY', '_New York'), 'WY' => _t('FedExStateProvinceExtension.US_WY', '_Wyoming'), 'IA' => _t('FedExStateProvinceExtension.US_IA', '_Iowa'), 'NC' => _t('FedExStateProvinceExtension.US_NC', '_North Carolina'), 'PR' => _t('FedExStateProvinceExtension.US_PR', '_Puerto Rico'), 'KS' => _t('FedExStateProvinceExtension.US_KS', '_Kansas'), 'ND' => _t('FedExStateProvinceExtension.US_ND', '_North Dakota'), 'KY' => _t('FedExStateProvinceExtension.US_KY', '_Kentucky'), 'OH' => _t('FedExStateProvinceExtension.US_OH', '_Ohio')), _t('FedExStateProvinceExtension.CANADA', '_Canada') => array('AB' => _t('FedExStateProvinceExtension.CA_AB', '_Alberta'), 'BC' => _t('FedExStateProvinceExtension.CA_BC', '_British Columbia'), 'MB' => _t('FedExStateProvinceExtension.CA_MB', '_Manitoba'), 'NB' => _t('FedExStateProvinceExtension.CA_NB', '_New Brunswick'), 'NL' => _t('FedExStateProvinceExtension.CA_NL', '_Newfoundland'), 'NT' => _t('FedExStateProvinceExtension.CA_NT', '_Northwest Territories and Labrador'), 'NS' => _t('FedExStateProvinceExtension.CA_NS', '_Nova Scotia'), 'NU' => _t('FedExStateProvinceExtension.CA_NU', '_Nunavut'), 'ON' => _t('FedExStateProvinceExtension.CA_ON', '_Ontario'), 'PE' => _t('FedExStateProvinceExtension.CA_PE', '_Prince Edward Island'), 'QC' => _t('FedExStateProvinceExtension.CA_QC', '_Quebec'), 'SK' => _t('FedExStateProvinceExtension.CA_SK', '_Saskatchewan'), 'YT' => _t('FedExStateProvinceExtension.CA_YT', '_Yukon')), '' => _t('FedExStateProvinceExtension.OTHER', '_Other')));
$newStateField->setDescription = $stateField->getDescription();
$newStateField->setForm($stateField->getForm());
$fields->replaceField('State', $newStateField);
$fields->insertAfter($otherState = new TextField('OtherState', _t('FedExStateProvinceExtension.OTHER_STATE', '_Other State'), null, 200), 'State');
$otherState->setDescription(_t('FedExStateProvinceExtension.OTHER_DESC', '_If you chose other as your state please place it here'));
$otherState->setForm($stateField->getForm());
}
}
开发者ID:webbuilders-group,项目名称:silverstripe-shop-fedex-shipping,代码行数:17,代码来源:FedExStateProvinceExtension.php