当前位置: 首页>>代码示例>>PHP>>正文


PHP CMS::textReplace方法代码示例

本文整理汇总了PHP中CMS::textReplace方法的典型用法代码示例。如果您正苦于以下问题:PHP CMS::textReplace方法的具体用法?PHP CMS::textReplace怎么用?PHP CMS::textReplace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CMS的用法示例。


在下文中一共展示了CMS::textReplace方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: replace

 protected function replace($model, $content)
 {
     if ($model instanceof Order) {
         $array['%ORDER_ID%'] = $model->id;
         $array['%ORDER_KEY%'] = $model->secret_key;
         $array['%TOTAL_PRICE%'] = ShopProduct::formatPrice(Yii::app()->currency->convert($model->full_price));
         $array['%USER_NAME%'] = $model->user_name;
         $array['%USER_PHONE%'] = $model->user_phone;
         $array['%USER_EMAIL%'] = $model->user_email;
         $array['%USER_ADDRESS%'] = $model->user_address;
         $array['%ORDER_URL%'] = $model->getAbsoluteUrl();
     }
     $array['%CURRENT_CURRENCY%'] = Yii::app()->currency->active->symbol;
     return CMS::textReplace($content, $array);
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:15,代码来源:CSMS.php

示例2: sendMessage

 public function sendMessage()
 {
     $config = Yii::app()->settings->get('contacts');
     $mails = explode(',', $config['form_emails']);
     $tempArray = array('{sender_name}' => $this->name, '{sender_email}' => $this->email, '{sender_message}' => CHtml::encode($this->msg), '{sender_phone}' => $this->phone);
     $mailer = Yii::app()->mail;
     $mailer->From = 'noreply@' . Yii::app()->request->serverName;
     $mailer->FromName = Yii::t('ContactsModule.default', 'FB_FORM_NAME');
     $mailer->Subject = Yii::t('ContactsModule.default', 'FB_FROM_MESSAGE', array('{name}' => isset($this->name) ? Html::encode($this->name) : $this->email, '{site_name}' => Yii::app()->settings->get('core', 'site_name')));
     $mailer->Body = Html::text(CMS::textReplace($config['tempMessage'], $tempArray));
     foreach ($mails as $mail) {
         $mailer->AddAddress($mail);
     }
     $mailer->isHtml(true);
     $mailer->AddReplyTo($this->email);
     $mailer->Send();
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:17,代码来源:ContactForm.php

示例3: replace_subject

 public function replace_subject($array)
 {
     return CMS::textReplace($this->subject, CMap::mergeArray($this->replace_default(), $array));
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:4,代码来源:TplMail.php

示例4: replaceMeta

 public function replaceMeta($text)
 {
     $array = array("%PRODUCT_NAME%" => $this->name, "%PRODUCT_PRICE%" => $this->price, "%PRODUCT_ARTICLE%" => $this->sku, "%PRODUCT_PCS%" => $this->pcs, "%PRODUCT_BRAND%" => $this->manufacturer->name, "%PRODUCT_MAIN_CATEGORY%" => $this->mainCategory->name, "%CURRENT_CURRENCY%" => Yii::app()->currency->active->symbol);
     return CMS::textReplace($text, $array);
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:5,代码来源:ShopProduct.php

示例5: replace

 protected function replace($order, $list, $content)
 {
     $replace = array('%ORDER_ID%', '%ORDER_KEY%', '%ORDER_DELIVERY_NAME%', '%ORDER_PAYMENT_NAME%', '%TOTAL_PRICE%', '%USER_NAME%', '%USER_PHONE%', '%USER_EMAIL%', '%USER_ADDRESS%', '%USER_COMMENT%', '%CURRENT_CURRENCY%', '%FOR_PAYMENY%', '%LIST%', '%LINK_TO_ORDER%');
     $to = array($order->id, $order->secret_key, $order->deliveryMethod->name, $order->paymentMethod->name, $order->total_price, $order->user_name, $order->user_phone, $order->user_email, $order->user_address, isset($order->user_comment) ? $order->user_comment : '', Yii::app()->currency->active->symbol, ShopProduct::formatPrice($order->total_price + $order->delivery_price), $list, Html::link($this->createAbsoluteUrl('view', array('secret_key' => $order->secret_key)), $this->createAbsoluteUrl('view', array('secret_key' => $order->secret_key))));
     return CMS::textReplace($content, $replace, $to);
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:6,代码来源:DefaultController.php

示例6: replaceMeta

 public function replaceMeta($text)
 {
     $replace = array("%CATEGORY_NAME%", "%SUB_CATEGORY_NAME%", "%CURRENT_CURRENCY%");
     $to = array($this->name, $this->parent()->find()->name == 'root' ? '' : $this->parent()->find()->name, Yii::app()->currency->active->symbol);
     return CMS::textReplace($text, $replace, $to);
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:6,代码来源:ShopCategory.php

示例7: getMessage

 public function getMessage()
 {
     $params = array();
     $params['%USER_LOGIN%'] = Yii::app()->user->login;
     return CMS::textReplace($this->message, $params);
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:6,代码来源:BSAds.php


注:本文中的CMS::textReplace方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。