本文整理匯總了PHP中CompositeField::SetID方法的典型用法代碼示例。如果您正苦於以下問題:PHP CompositeField::SetID方法的具體用法?PHP CompositeField::SetID怎麽用?PHP CompositeField::SetID使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CompositeField
的用法示例。
在下文中一共展示了CompositeField::SetID方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getFields
/**
* Puts together the fields for the Order Form (and other front-end purposes).
* @return Fieldset
**/
public function getFields($member = null)
{
$fields = parent::getEcommerceFields();
if (EcommerceConfig::get("OrderAddress", "use_separate_shipping_address")) {
$shippingFieldsHeader = new CompositeField(new HeaderField('SendGoodsToADifferentAddress', _t('OrderAddress.SENDGOODSTODIFFERENTADDRESS', 'Send goods to different address'), 3), new LiteralField('ShippingNote', '<p class="message warning">' . _t('OrderAddress.SHIPPINGNOTE', 'Your goods will be sent to the address below.') . '</p>'), new LiteralField('ShippingHelp', '<p>' . _t('OrderAddress.SHIPPINGHELP', 'You can use this for gift giving. No billing information will be disclosed to this address.') . '</p>'));
if ($member) {
if ($member->exists()) {
$addresses = $this->previousAddressesFromMember($member);
if ($addresses) {
if ($addresses->count() > 1) {
$shippingFieldsHeader->push(new SelectOrderAddressField('SelectShippingAddressField', _t('OrderAddress.SELECTBILLINGADDRESS', 'Select Shipping Address'), $addresses));
}
}
}
$shippingFields = new CompositeField(new TextField('ShippingFirstName', _t('OrderAddress.FIRSTNAME', 'First Name')), new TextField('ShippingSurname', _t('OrderAddress.SURNAME', 'Surname')));
} else {
$shippingFields = new CompositeField(new TextField('ShippingFirstName', _t('OrderAddress.FIRSTNAME', 'First Name')), new TextField('ShippingSurname', _t('OrderAddress.SURNAME', 'Surname')));
}
$shippingFields->push(new TextField('ShippingPrefix', _t('OrderAddress.PREFIX', 'Title (e.g. Ms)')));
$shippingFields->push(new TextField('ShippingAddress', _t('OrderAddress.ADDRESS', 'Address')));
$shippingFields->push(new TextField('ShippingAddress2', _t('OrderAddress.ADDRESS2', ' ')));
$shippingFields->push(new TextField('ShippingCity', _t('OrderAddress.CITY', 'Town')));
$shippingFields->push($this->getPostalCodeField("ShippingPostalCode"));
$shippingFields->push($this->getRegionField("ShippingRegionID"));
$shippingFields->push($this->getCountryField("ShippingCountry"));
$shippingFields->push(new TextField('ShippingPhone', _t('OrderAddress.PHONE', 'Phone')));
$shippingFields->push(new TextField('ShippingMobilePhone', _t('OrderAddress.MOBILEPHONE', 'Mobile Phone')));
$this->makeSelectedFieldsReadOnly($shippingFields);
$shippingFieldsHeader->SetID("ShippingFieldsHeader");
$shippingFields->addExtraClass("orderAddressHolder");
$fields->push($shippingFieldsHeader);
$shippingFields->SetID('ShippingFields');
$fields->push($shippingFields);
}
$this->extend('augmentEcommerceShippingAddressFields', $fields);
return $fields;
}
示例2: getFields
/**
*@return Fieldset
**/
public function getFields($member = null)
{
$fields = parent::getEcommerceFields();
$fields->push(new HeaderField('BillingDetails', _t('OrderAddress.BILLINGDETAILS', 'Billing Details'), 3));
if ($member) {
if ($member->exists()) {
$addresses = $this->previousAddressesFromMember($member);
if ($addresses) {
if ($addresses->count() > 1) {
$fields->push(new SelectOrderAddressField('SelectBillingAddressField', _t('OrderAddress.SELECTBILLINGADDRESS', 'Select Billing Address'), $addresses));
}
}
}
$billingFields = new CompositeField(new EmailField('Email', _t('OrderAddress.EMAIL', 'Email')), new TextField('FirstName', _t('OrderAddress.FIRSTNAME', 'First Name')), new TextField('Surname', _t('OrderAddress.SURNAME', 'Surname')));
} else {
$billingFields = new CompositeField(new EmailField('Email', _t('OrderAddress.EMAIL', 'Email')), new TextField('FirstName', _t('OrderAddress.FIRSTNAME', 'First Name')), new TextField('Surname', _t('OrderAddress.SURNAME', 'Surname')));
}
$billingFields->push(new TextField('Prefix', _t('OrderAddress.PREFIX', 'Title (e.g. Ms)')));
$billingFields->push(new TextField('Address', _t('OrderAddress.ADDRESS', 'Address')));
$billingFields->push(new TextField('Address2', _t('OrderAddress.ADDRESS2', ' ')));
$billingFields->push(new TextField('City', _t('OrderAddress.CITY', 'Town')));
$billingFields->push($this->getPostalCodeField("PostalCode"));
$billingFields->push($this->getRegionField("RegionID"));
$billingFields->push($this->getCountryField("Country"));
$billingFields->push(new TextField('Phone', _t('OrderAddress.PHONE', 'Phone')));
$billingFields->push(new TextField('MobilePhone', _t('OrderAddress.MOBILEPHONE', 'Mobile Phone')));
$billingFields->SetID('BillingFields');
$billingFields->addExtraClass("orderAddressHolder");
$this->makeSelectedFieldsReadOnly($billingFields);
$fields->push($billingFields);
$this->extend('augmentEcommerceBillingAddressFields', $fields);
return $fields;
}