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