本文整理汇总了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;
}