本文整理匯總了PHP中convert::raw2att方法的典型用法代碼示例。如果您正苦於以下問題:PHP convert::raw2att方法的具體用法?PHP convert::raw2att怎麽用?PHP convert::raw2att使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類convert
的用法示例。
在下文中一共展示了convert::raw2att方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* @param Controller $controller
* @param String $name
* @param Order $order
* @param String
*/
function __construct(Controller $controller, $name, Order $order, $returnToLink = '')
{
$fields = new FieldList(new HiddenField('OrderID', '', $order->ID));
if ($returnToLink) {
$fields->push(new HiddenField("returntolink", "", convert::raw2att($returnToLink)));
}
$bottomFields = new CompositeField();
$bottomFields->addExtraClass('bottomOrder');
if ($order->Total() > 0) {
$paymentFields = EcommercePayment::combined_form_fields($order->getTotalAsMoney()->NiceLongSymbol(false), $order);
foreach ($paymentFields as $paymentField) {
$bottomFields->push($paymentField);
}
if ($paymentRequiredFields = EcommercePayment::combined_form_requirements($order)) {
$requiredFields = array_merge($requiredFields, $paymentRequiredFields);
}
} else {
$bottomFields->push(new HiddenField("PaymentMethod", "", ""));
}
$fields->push($bottomFields);
$actions = new FieldList(new FormAction('dopayment', _t('OrderForm.PAYORDER', 'Pay balance')));
$requiredFields = array();
$validator = OrderForm_Payment_Validator::create($requiredFields);
$form = parent::__construct($controller, $name, $fields, $actions, $validator);
//extension point
$this->extend('updateFields', $fields);
$this->setFields($fields);
$this->extend('updateActions', $actions);
$this->setActions($actions);
$this->extend('updateValidator', $validator);
$this->setValidator($validator);
$this->setFormAction($controller->Link($name));
$oldData = Session::get("FormInfo.{$this->FormName()}.data");
if ($oldData && (is_array($oldData) || is_object($oldData))) {
$this->loadDataFrom($oldData);
}
$this->extend('updateOrderForm_Payment', $this);
}
示例2: __construct
function __construct($controller, $name, $order, $returnToLink = '')
{
$fields = new FieldSet(new HiddenField('OrderID', '', $order->ID));
if ($returnToLink) {
$fields->push(new HiddenField("returntolink", "", convert::raw2att($returnToLink)));
}
$totalAsCurrencyObject = $order->TotalAsCurrencyObject();
$totalOutstandingAsMoneyObject = $order->TotalOutstandingAsMoneyObject();
$paymentFields = Payment::combined_form_fields($totalOutstandingAsMoneyObject->Nice());
foreach ($paymentFields as $paymentField) {
if ($paymentField->class == "HeaderField") {
$paymentField->setTitle(_t("OrderForm.MAKEPAYMENT", "Make Payment"));
}
$fields->push($paymentField);
}
$requiredFields = array();
if ($paymentRequiredFields = Payment::combined_form_requirements()) {
$requiredFields = array_merge($requiredFields, $paymentRequiredFields);
}
$actions = new FieldSet(new FormAction('dopayment', _t('OrderForm.PAYORDER', 'Pay balance')));
$form = parent::__construct($controller, $name, $fields, $actions, $requiredFields);
if ($this->extend('updateFields', $fields) !== null) {
$this->setFields($fields);
}
if ($this->extend('updateActions', $actions) !== null) {
$this->setActions($actions);
}
if ($this->extend('updateValidator', $validator) !== null) {
$this->setValidator($validator);
}
$this->setFormAction($controller->Link($name));
$this->extend('updateOrderFormPayment', $this);
}