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


PHP CMS::gen方法代碼示例

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


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

示例1: init

 public function init()
 {
     if (!Yii::app()->user->isGuest) {
         // NEED CONFINGURE
         $this->name = Yii::app()->user->getUsername();
         $this->phone = Yii::app()->user->phone;
         $this->address = Yii::app()->user->address;
         $this->email = Yii::app()->user->email;
     } else {
         $this->_newpassword = CMS::gen((int) Yii::app()->settings->get('users', 'min_password') + 2);
         $this->_password = User::encodePassword($this->_newpassword);
     }
 }
開發者ID:buildshop,項目名稱:bs-common,代碼行數:13,代碼來源:OrderCreateForm.php

示例2: uploadFile

 public function uploadFile($attr, $dir, $old_image = null)
 {
     $file = CUploadedFile::getInstance($this, $attr);
     $path = Yii::getPathOfAlias($dir) . DS;
     if (isset($file)) {
         if ($old_image) {
             unlink($path . $old_image);
         }
         $newname = CMS::gen(10) . "." . $file->extensionName;
         $img = Yii::app()->img;
         $img->load($file->tempName);
         $img->save($path . $newname);
         $this->{$attr} = (string) $newname;
     } else {
         $this->{$attr} = (string) $old_image;
     }
 }
開發者ID:buildshop,項目名稱:bs-common,代碼行數:17,代碼來源:ActiveRecord.php

示例3: renderPaymentForm

 public function renderPaymentForm(ShopPaymentMethod $method, Order $order)
 {
     $html = '
         <form action="https://api.privatbank.ua/p24api/ishop" method="POST" accept-charset="UTF-8">
             <input type="hidden" name="amt" value="{AMOUNT}"/>
             <input type="hidden" name="ccy" value="UAH" />
             <input type="hidden" name="merchant" value="{MERCHANT_ID}" />
             <input type="hidden" name="order" value="{ORDER}" />
             <input type="hidden" name="details" value="{ORDER_TITLE}" />
             <input type="hidden" name="ext_details" value="{ORDER_ID}" />
             <input type="hidden" name="pay_way" value="privat24" />
             <input type="hidden" name="return_url" value="{SUCCESS_URL}" />
             <input type="hidden" name="server_url" value="{RESULT_URL}" />
             {SUBMIT}
         </form>';
     $settings = $this->getSettings($method->id);
     $html = strtr($html, array('{AMOUNT}' => Yii::app()->currency->convert($order->full_price, $method->currency_id), '{ORDER_ID}' => $order->id, '{ORDER_TITLE}' => Yii::t('CartModule.default', 'PAYMENT_ORDER', array('{id}' => $order->id)), '{MERCHANT_ID}' => $settings['MERCHANT_ID'], '{ORDER}' => CMS::gen(5) . $order->id, '{SUCCESS_URL}' => Yii::app()->createAbsoluteUrl('/cart/payment/process', array('payment_id' => $method->id)), '{RESULT_URL}' => Yii::app()->createAbsoluteUrl('/cart/payment/process', array('payment_id' => $method->id, 'result' => true)), '{SUBMIT}' => $this->renderSubmit()));
     return $order->paid ? false : $html;
 }
開發者ID:buildshop,項目名稱:bs-common,代碼行數:19,代碼來源:Privat24PaymentSystem.php

示例4:

<form action="https://api.privatbank.ua/p24api/ishop" method="POST" accept-charset="UTF-8">
    <input type="hidden" name="amt" value="<?php 
echo $price;
?>
"/>
    <input type="hidden" name="ccy" value="UAH" />
    <input type="hidden" name="merchant" value="110541" />
    <input type="hidden" name="order" value="<?php 
echo CMS::gen(10);
?>
" />
    <input type="hidden" name="details" value="Продление интернет-магазина pro.buildshop.net на 5 месяцов" />
    <input type="hidden" name="ext_details" value="PLAN_PRO" />
    <input type="hidden" name="pay_way" value="privat24" />
    <input type="hidden" name="return_url" value="http://pro.buildshop.net/admin/core/service/success" />
    <input type="hidden" name="server_url" value="http://pro.buildshop.net/admin/core/service/success" />
    <input type="submit" value="Оплатить" class="btn btn-success" />
</form>
開發者ID:buildshop,項目名稱:bs-common,代碼行數:18,代碼來源:privat24.php


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