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


PHP IReq::set方法代码示例

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


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

示例1: beginUrl

 /**
  * @brief 获取url参数
  * @param String url 需要分析的url,默认为当前url
  */
 public static function beginUrl($url = '')
 {
     //四种
     //native: /index.php?controller=blog&action=read&id=100
     //pathinfo:/blog/read/id/100
     //native-pathinfo:/index.php/blog/read/id/100
     //diy:/blog-100.html
     $obj = IServerVars::factory($_SERVER['SERVER_SOFTWARE']);
     $url = !empty($url) ? $url : $obj->realUri();
     preg_match('/\\.php(.*)/', $url, $phpurl);
     if (!isset($phpurl[1]) || !$phpurl[1]) {
         if ($url != "") {
             //强行赋值
             //todo:检测是否有bug
             $phpurl = array(1 => "?");
         } else {
             return;
         }
     }
     $url = $phpurl[1];
     $urlArray = array();
     $rewriteRule = isset(IWeb::$app->config['rewriteRule']) ? IWeb::$app->config['rewriteRule'] : 'native';
     if ($rewriteRule != 'native') {
         $urlArray = self::decodeRouteUrl($url);
     }
     if ($urlArray == array()) {
         if ($url[0] == '?') {
             $urlArray = $_GET;
         } else {
             $urlArray = self::pathinfoToArray($url);
         }
     }
     if (isset($urlArray[self::UrlCtrlName])) {
         $tmp = explode('-', $urlArray[self::UrlCtrlName]);
         if (count($tmp) == 2) {
             IReq::set('module', $tmp[0]);
             IReq::set(self::UrlCtrlName, $tmp[1]);
         } else {
             IReq::set(self::UrlCtrlName, $urlArray[self::UrlCtrlName]);
         }
     }
     if (isset($urlArray[self::UrlActionName])) {
         IReq::set(self::UrlActionName, $urlArray[self::UrlActionName]);
         if (IReq::get('action') == 'run') {
             IReq::set('action', null);
         }
     }
     unset($urlArray[self::UrlActionName], $urlArray[self::UrlActionName], $urlArray[self::Anchor]);
     foreach ($urlArray as $key => $value) {
         IReq::set($key, $value);
     }
 }
开发者ID:chenyongze,项目名称:iwebshop,代码行数:56,代码来源:urlmanager_class.php

示例2: order_message

 /**
  * @brief 保存顾客留言
  */
 public function order_message()
 {
     //获得post数据
     $order_id = IFilter::act(IReq::get('order_id'), 'int');
     $user_id = IFilter::act(IReq::get('user_id'), 'int');
     $title = IFilter::act(IReq::get('title'));
     $content = IFilter::act(IReq::get('content'), 'text');
     //获得message的表对象
     $tb_message = new IModel('message');
     $tb_message->setData(array('title' => $title, 'content' => $content, 'time' => date('Y-m-d H:i:s')));
     $message_id = $tb_message->add();
     //获的mess类
     $message = new Mess($user_id);
     $message->writeMessage($message_id);
     IReq::set('id', $order_id);
     $this->order_show();
 }
开发者ID:yongge666,项目名称:sunupedu,代码行数:20,代码来源:order+-+2015-9-19.php

示例3: order_accept

 /**
  * 修改收件人信息
  * */
 public function order_accept()
 {
     $id = IFilter::act(IReq::get('order_id'), 'int');
     $mess = '';
     if ($id) {
         $order_array = array('postcode' => IFilter::act(IReq::get('postcode')), 'accept_name' => IFilter::act(IReq::get('accept_name')), 'province' => IFilter::act(IReq::get('province')), 'city' => IFilter::act(IReq::get('city')), 'area' => IFilter::act(IReq::get('area')), 'school' => IFilter::act(IReq::get('school')), 'address' => IFilter::act(IReq::get('address')), 'telphone' => IFilter::act(IReq::get('telphone')), 'mobile' => IFilter::act(IReq::get('mobile')));
         $tb_order = new IModel('order');
         $orderRow = $tb_order->getObj('id = ' . $id);
         //比对省份是否改变,从而重新计算运费
         if ($order_array['province'] != $orderRow['province']) {
             //获取订单物品重量
             $goods_weight = IFilter::act(IReq::get('goods_weight'), 'float');
             //调入数据,获得配送方式结果
             $deliveryData = Delivery::getDelivery($order_array['province'], $goods_weight);
             //所选择的省份不能送达
             if ($deliveryData[$orderRow['distribution']]['if_delivery'] == 1) {
                 $mess = '对不起,该地区不能送达,请您重新选择省份';
             } else {
                 if ($deliveryData[$orderRow['distribution']]['price'] != $orderRow['payable_freight']) {
                     $order_array['payable_freight'] = $deliveryData[$orderRow['distribution']]['price'];
                     //非免运费
                     if ($orderRow['real_freight'] > 0) {
                         $order_array['real_freight'] = $order_array['payable_freight'];
                         //修正订单最终总金额
                         $order_array['order_amount'] = $orderRow['order_amount'] + $order_array['payable_freight'] - $orderRow['real_freight'];
                     }
                 }
             }
         }
         //无错误信息运行正常
         if ($mess == '') {
             $mess = '更新成功!';
             $tb_order->setData($order_array);
             if ($tb_order->update('id = ' . $id . ' and user_id = ' . $this->user['user_id']) === false) {
                 $mess = '收件人更新失败!';
             }
         }
     } else {
         $mess = '您的操作失败!';
     }
     IReq::set('id', $id);
     $this->order_detail();
     Util::showMessage($mess);
 }
开发者ID:yongge666,项目名称:sunupedu,代码行数:47,代码来源:ucenter.php

示例4: order_accept

 /**
  * 修改收件人信息
  * */
 public function order_accept()
 {
     $id = IFilter::act(IReq::get('order_id'), 'int');
     $freight = IReq::get('freight_real');
     $mess = '您的操作成功!';
     if ($id) {
         $tb_order = new IModel('order');
         $order_array = array('accept_name' => IFilter::act(IReq::get('accept_name')), 'province' => IFilter::act(IReq::get('province')), 'city' => IFilter::act(IReq::get('city')), 'area' => IFilter::act(IReq::get('area')), 'address' => IFilter::act(IReq::get('address')), 'telphone' => IFilter::act(IReq::get('telphone')), 'mobile' => IFilter::act(IReq::get('mobile')), 'real_freight' => IFilter::act(IReq::get('freight_real')), 'order_amount' => IFilter::act(IReq::get('order_total')));
         $tb_order->setData($order_array);
         if ($tb_order->update('id=' . $id) === false) {
             $mess = '收件人更新失败!';
         }
     } else {
         $mess = '您的操作失败!';
     }
     IReq::set('id', $id);
     $this->order_detail();
     Util::showMessage($mess);
 }
开发者ID:chenyongze,项目名称:iwebshop,代码行数:22,代码来源:ucenter.php


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