當前位置: 首頁>>代碼示例>>PHP>>正文


PHP convert::raw2js方法代碼示例

本文整理匯總了PHP中convert::raw2js方法的典型用法代碼示例。如果您正苦於以下問題:PHP convert::raw2js方法的具體用法?PHP convert::raw2js怎麽用?PHP convert::raw2js使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在convert的用法示例。


在下文中一共展示了convert::raw2js方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: init

    /**
     * Standard SS function
     * if set to false, user can edit order, if set to true, user can only review order
     **/
    public function init()
    {
        parent::init();
        Requirements::themedCSS('CheckoutPage');
        Requirements::javascript('ecommerce/javascript/EcomPayment.js');
        Requirements::customScript('
			if (typeof EcomOrderForm != "undefined") {
				EcomOrderForm.set_TermsAndConditionsMessage(\'' . convert::raw2js($this->TermsAndConditionsMessage) . '\');
			}', "TermsAndConditionsMessage");
        $this->steps = EcommerceConfig::get("CheckoutPage_Controller", "checkout_steps");
        if ($this->HasCheckoutSteps) {
            $this->currentStep = $this->request->Param("ID");
            if ($this->currentStep && in_array($this->currentStep, $this->steps)) {
                //do nothing
            } else {
                $this->currentStep = array_shift($this->steps);
            }
        }
    }
開發者ID:nieku,項目名稱:silverstripe-ecommerce,代碼行數:23,代碼來源:CheckoutPage.php

示例2: init

    /**
     * Standard SS function
     * if set to false, user can edit order, if set to true, user can only review order
     **/
    public function init()
    {
        parent::init();
        Requirements::themedCSS('CheckoutPage', 'ecommerce');
        $ajaxifyArray = EcommerceConfig::get("CheckoutPage_Controller", "ajaxify_steps");
        if (count($ajaxifyArray)) {
            foreach ($ajaxifyArray as $js) {
                Requirements::javascript($js);
            }
        }
        Requirements::javascript('ecommerce/javascript/EcomPayment.js');
        Requirements::customScript('
			if (typeof EcomOrderForm != "undefined") {
				EcomOrderForm.set_TermsAndConditionsMessage(\'' . convert::raw2js($this->TermsAndConditionsMessage) . '\');
			}', "TermsAndConditionsMessage");
        $this->steps = EcommerceConfig::get("CheckoutPage_Controller", "checkout_steps");
        $this->currentStep = $this->request->Param("ID");
        if ($this->currentStep && in_array($this->currentStep, $this->steps)) {
            //do nothing
        } else {
            $this->currentStep = array_shift($this->steps);
        }
        //redirect to current order -
        // this is only applicable when people submit order (start to pay)
        // and then return back
        if ($checkoutPageCurrentOrderID = Session::get("CheckoutPageCurrentOrderID")) {
            if (!$this->currentOrder || $this->currentOrder->ID != $checkoutPageCurrentOrderID) {
                if ($order = Order::get_by_id_if_can_view(intval($checkoutPageCurrentOrderID))) {
                    Session::clear("CheckoutPageCurrentOrderID");
                    Session::set("CheckoutPageCurrentOrderID", 0);
                    Session::save();
                    return $this->redirect($order->Link());
                }
            }
        }
        if ($this->currentOrder) {
            //we make sure all the OrderModifiers are up to date....
            Session::set("CheckoutPageCurrentOrderID", $this->currentOrder->ID);
        }
    }
開發者ID:helpfulrobot,項目名稱:sunnysideup-ecommerce,代碼行數:44,代碼來源:CheckoutPage.php


注:本文中的convert::raw2js方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。