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