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


PHP UrlUtil::createUrl方法代码示例

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


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

示例1: message

 public function message($message, $returnBack = '')
 {
     if ($returnBack) {
         $returnBack = UrlUtil::createUrl($returnBack);
     }
     $this->view('message', array('message' => $message, 'returnBack' => $returnBack));
     $this->output->_display();
     exit;
 }
开发者ID:guohao214,项目名称:xinya,代码行数:9,代码来源:BaseController.php

示例2: index

 /**
  * 展示店铺
  */
 public function index()
 {
     $returnUrl = $this->input->get('returnUrl', true);
     if ($returnUrl) {
         $returnUrl = urldecode($returnUrl);
     }
     if (!$returnUrl || !UrlUtil::isValidUrl($returnUrl)) {
         $returnUrl = UrlUtil::createUrl('project/index');
     }
     $this->outputCache();
     $shops = (new ShopModel())->allShops();
     $this->view('shop/index', array('shops' => $shops, 'returnUrl' => $returnUrl));
 }
开发者ID:guohao214,项目名称:xinya,代码行数:16,代码来源:Shop.php

示例3: index

 /**
  * 展示预约页面
  * 选择美容师与预约时间
  * 此处要验证授权
  *
  * @param $shopId 店铺ID
  */
 public function index($shopId)
 {
     $weixinUtil = new WeixinUtil();
     // 验证是否已授权
     $weixinUtil->authorize("appointment/index/{$shopId}");
     // 获得预约项目
     $projectId = (new CartUtil())->cart();
     $projectId += 0;
     if (!$projectId) {
         $this->message('预约项目不存在!');
     }
     $openId = $weixinUtil->getOpenId();
     if ((new ProjectPropertyModel())->projectOnlyForNewUser($projectId, $openId)) {
         $this->message('此美容项目只针对新用户!');
     }
     //是否已经选择了店铺,并且店铺是有效的
     $shops = (new ShopModel())->getAllShops();
     if (is_numeric($shopId) && array_key_exists($shopId, $shops)) {
         // 获得项目信息
         $project = (new ProjectModel())->readOne($projectId);
         if (!$project) {
             $this->message('预约项目不存在!');
         }
         // 跳转到 选择 美容师
         $beauticians = (new BeauticianModel())->getAllBeauticians();
         $lastOrder = (new OrderModel())->getLastOrder($openId);
         $days = DateUtil::buildDays();
         $coupons = array();
         if ($project['can_use_coupon']) {
             // 查询优惠券
             $coupons = (new CustomerCouponModel())->getCustomerNotUseCouponList($openId);
         }
         $this->load->view('frontend/appointment/beautician', array('beauticians' => $beauticians, 'project' => $project, 'shopId' => $shopId, 'days' => $days, 'lastOrder' => $lastOrder, 'coupons' => $coupons));
     } else {
         // 跳转到选择店铺
         $returnUrl = urlencode(UrlUtil::createUrl('appointment/index'));
         ResponseUtil::redirect(UrlUtil::createUrl("shop/index?returnUrl={$returnUrl}"));
     }
 }
开发者ID:guohao214,项目名称:xinya,代码行数:46,代码来源:Appointment.php

示例4: foreach

?>
"></a>
    <h2>积分兑换</h2>
</header>
<section>
    <div class="tab_wrap">
        <ul class="tabs j_scroll" id="iScroll0" style="">
            <li class="">
                <a href="<?php 
echo UrlUtil::createUrl("exchange/coupon");
?>
"><i></i>兑换优惠券</a>
            </li>
            <li class="current">
                <a href="<?php 
echo UrlUtil::createUrl("exchange/exchangeGoods");
?>
"><i></i>兑换商品</a>
            </li>
        </ul>
    </div>
    <?php 
if ($products) {
    ?>
        <?php 
    foreach ($products as $product) {
        ?>
            <div class="itemlist loaded">
                <div class="item ">
                    <dl>
                        <dt>
开发者ID:guohao214,项目名称:xinya,代码行数:31,代码来源:exchangeGoods.php

示例5: nl2br

    ?>
</p>
            </div>
        <?php 
}
?>

        <div class="item_desc">
            <ul class="tags">
                <li class="F15 project_effect">功效</li>
            </ul>
            <p><?php 
echo nl2br($project['effects']);
?>
</p>
        </div>
    </div>
</section>
<footer>
    <a class="project_footer F18" data-id="<?php 
echo $project['project_id'];
?>
"
       href="<?php 
echo UrlUtil::createUrl("appointment/index/{$shopId}");
?>
">预约</a>
</footer>

</body>
</html>
开发者ID:guohao214,项目名称:xinya,代码行数:31,代码来源:detail.php

示例6:

                        class="F18 colorR">¥</strong> <strong
                        class="F18 colorR totalAmount"><?php 
echo $totalAmount;
?>
</strong></i>
                <!--<P><samp class="colorH">支付状态:</samp>未支付</P>-->
            </dd>
        </dl>

    </div>
</section>


<div id="divMsg">
    <form action="<?php 
echo UrlUtil::createUrl('cart/order');
?>
" id="create-order" method="post">
        <div class="pay">
            <strong>
                <a id="aClose" href="javascript:; " onclick="document.body.id = ''; "></a>
                <span class="F16">完善信息</span>
            </strong>
            <ul>
                <li>
                    <samp>联系人:</samp>
                    <span><input type="text" name="user_name" class="order-text"></span>
                </li>
                <li>
                    <samp>手机号:</samp>
                    <span><input type="tel" name="phone" class="order-text"></span>
开发者ID:guohao214,项目名称:xinya,代码行数:31,代码来源:index.php

示例7: urlencode

<header>
    <h2>订单支付(请在10分钟之内支付)</h2>
</header>

<input type="hidden" name="pay-params" value="<?php 
echo urlencode($payParams);
?>
">
<input type="hidden" name="pay-redirect-url" value="<?php 
echo UrlUtil::createUrl('userCenter/order');
?>
">

<section>
    <div class="order">
        <dl class="order_list">
            <dd>
                <div></div>
                <samp class="order_number">订单:<span class="F14">
                        <?php 
echo $order['order_no'];
?>
                    </span></samp>
            </dd>
            <dt>
            <div class="order_list_dtDiv">
                <a>
                    <img
                        src="<?php 
echo UploadUtil::buildUploadDocPath($order['project_cover'], '100x100');
?>
开发者ID:guohao214,项目名称:xinya,代码行数:31,代码来源:pay.php

示例8: foreach

            <div class="itemlist loaded">
                <div class="title_index">
                    <span><p class="F16 FB <?php 
    echo 'category-list-' . $key;
    ?>
 "><?php 
    echo $categories[$key];
    ?>
</p></span>
                </div>
                <?php 
    foreach ($project as $pj) {
        ?>
                    <div class="item ">
                        <a href="<?php 
        echo UrlUtil::createUrl('project/detail/' . $pj['project_id'] . '/' . $shopId);
        ?>
">
                            <dl>
                                <dt>
                                    <img
                                        src="<?php 
        echo UploadUtil::buildUploadDocPath($pj['project_cover'], '100x100');
        ?>
">
                                </dt>
                                <dd>
                                    <h3><?php 
        echo $pj['project_name'];
        ?>
</h3>
开发者ID:guohao214,项目名称:xinya,代码行数:31,代码来源:index.php

示例9: authorize

 /**
  * 授权
  * @param $returnUrl
  * @return bool
  */
 public function authorize($returnUrl)
 {
     if (!$returnUrl) {
         get_instance()->message('授权回调地址为空!');
     }
     // 如果是微信授权后返回
     if (isset($_GET['code'])) {
         // 获得accessToken
         $callback = $this->loginCallback($_GET['code']);
         if (!$callback) {
             get_instance()->message('获得微信授权失败,请重试!');
         }
     }
     // 检测是否已经授权
     $openId = $this->getOpenId();
     if ($openId) {
         // 刷新token过期
         if ($this->isNeedRefreshAccessToken()) {
             if (!$this->refreshAccessToken()) {
                 ResponseUtil::redirect($this->toAuthorize(UrlUtil::createUrl($returnUrl)));
             }
         }
     } else {
         // 去微信授权
         ResponseUtil::redirect($this->toAuthorize(UrlUtil::createUrl($returnUrl)));
     }
     return true;
 }
开发者ID:guohao214,项目名称:xinya,代码行数:33,代码来源:WeixinUtil.php

示例10: array

<?php

/**
 * 返回微信配置信息
 * User: GuoHao
 * Date: 2015/12/28
 * Time: 22:09
 */
return array('appId' => 'wx27a6cf47215a1bd5', 'appSecret' => 'a3574d70989669c536312ba0e748c5ed', 'mchId' => '1301545301', 'apiKey' => 'xinyameirong2016liyinuo201006011', 'noticeUrl' => UrlUtil::createUrl('order/notice'));
开发者ID:guohao214,项目名称:xinya,代码行数:9,代码来源:weixin.php

示例11: get_instance

    <script src="<?php 
echo get_instance()->config->base_url();
?>
static/jquery.min.js"></script>
</head>
<body>
<div class="topbar-wrap white">
    <div class="topbar-inner clearfix">
        <div class="topbar-logo-wrap clearfix">
            <ul class="navbar-list clearfix">
                <li><a class="on" href="<?php 
echo UrlUtil::createBackendUrl('project/index');
?>
">首页</a></li>
                <li><a href="<?php 
echo UrlUtil::createUrl('project/index');
?>
" target="_blank">网站首页</a></li>
            </ul>
        </div>
        <div class="top-info-wrap">
            <ul class="top-info-list clearfix">
                <li><a><?php 
echo UserUtil::getUserName();
?>
</a></li>
                <li><a href="<?php 
echo UrlUtil::createBackendUrl('user/changePassword/' . UserUtil::getUserId());
?>
">修改密码</a></li>
                <li><a href="<?php 
开发者ID:guohao214,项目名称:xinya,代码行数:31,代码来源:layout.php

示例12: elseif

        echo $order['beautician_name'];
        ?>
</span>
                                </p></strong>

                                <i class="order_list_i"></i>
                            </div>
                        </a>
                    </dt>
                    <dd>
                        <?php 
        if ($order['order_sign'] == OrderModel::ORDER_NOT_PAY && DateUtil::orderIsValidDate($order['create_time'])) {
            ?>
                            <a class="colorW"
                               href="<?php 
            echo UrlUtil::createUrl('order/pay/' . $order['order_no']);
            ?>
">去支付</a>
                            <a class="colorW cancel-order" data-val="<?php 
            echo $order['order_id'];
            ?>
"
                               style="margin-left: 15px;">取消订单</a>
                        <?php 
        } elseif ($order['order_sign'] == OrderModel::ORDER_NOT_PAY && !DateUtil::orderIsValidDate($order['create_time'])) {
            ?>
                            <a class="order-expire">订单已过期</a>
                        <?php 
        } elseif ($order['order_sign'] == OrderModel::ORDER_CANCEL) {
            ?>
                            <a class="order-expire">订单已取消</a>
开发者ID:guohao214,项目名称:xinya,代码行数:31,代码来源:order.php

示例13:

?>
" data-path="project">
        <i></i>
        <span>预约</span>
    </a>
    <a href="<?php 
echo UrlUtil::createUrl('shop/index');
?>
" data-path="shop">
        <i></i>
        <span>店铺</span>
    </a>
    <a href="<?php 
echo UrlUtil::createUrl('userCenter/order');
?>
" data-path="cart">
        <i></i>
        <span>订单</span>
    </a>
    <a href="<?php 
echo UrlUtil::createUrl('userCenter/index');
?>
" data-path="userCenter">
        <i></i>
        <span>我的</span>
    </a>
</footer>

</body>

</html>
开发者ID:guohao214,项目名称:xinya,代码行数:31,代码来源:layout.php

示例14: order


//.........这里部分代码省略.........
             $this->message('选择的优惠券已被使用!');
         }
         // 是否到领取时间
         if ($today < $coupon['start_time']) {
             $this->message('优惠券未到使用时间!');
         }
         if ($today > $coupon['expire_time']) {
             $this->message('优惠券已到期!');
         }
     } else {
         if ($couponCode) {
             $couponId = '';
             $queryCouponCode = $couponCodeModel->readOneByCode($couponCode);
             if (!$queryCouponCode) {
                 $this->message('优惠码不存在!');
             }
             // 是否到使用时间
             if ($today < $queryCouponCode['start_time']) {
                 $this->message('优惠码未到使用时间!');
             }
             // 是有已过期
             if ($today > $queryCouponCode['expire_time']) {
                 $this->message('优惠码已到期!');
             }
         } else {
         }
     }
     //**********处理下单************//
     $projectId = (new CartUtil())->cart();
     if (empty($projectId) || $projectId <= 0) {
         $this->message('预约项目为空!');
     }
     if ((new ProjectPropertyModel())->projectOnlyForNewUser($projectId, $openId)) {
         $this->message('此美容项目只针对新用户!');
     }
     $orderProjectModel = new OrderProjectModel();
     // 获得购物车的项目
     $project = (new ProjectModel())->readOne($projectId);
     // 判断订单金额是否可以使用优惠券
     $totalFee = $originalTotalFee = $project['price'];
     if ($couponId && $project['can_use_coupon']) {
         if ($totalFee < $coupon['use_rule']) {
             $this->message('当前订单金额不足' . $coupon['use_rule'] . '元,不能使用此优惠券');
         }
     } else {
         if ($couponCode && $project['can_use_coupon_code']) {
             if ($totalFee < $queryCouponCode['use_rule']) {
                 $this->message('当前订单金额不足' . $queryCouponCode['use_rule'] . '元,不能使用此优惠码');
             }
         } else {
         }
     }
     // 生成订单号, 有重复订单号则重新生成,直到不重复为止
     $orderNo = StringUtil::generateOrderNo();
     $orderModel = new OrderModel();
     while ((new CurdUtil($orderModel))->readOne(array('order_no' => $orderNo))) {
         $orderNo = StringUtil::generateOrderNo();
     }
     // 优惠
     if ($couponId && $project['can_use_coupon']) {
         // 使用优惠码, 抵消金额
         $totalFee -= $coupon['counteract_amount'];
     } else {
         if ($couponCode && $project['can_use_coupon_code']) {
             $totalFee *= $queryCouponCode['discount'];
         } else {
         }
     }
     // 订单数据
     $orderData = array('order_no' => $orderNo, 'shop_id' => $shopId, 'create_time' => DateUtil::now(), 'original_total_fee' => $originalTotalFee, 'total_fee' => $totalFee, 'open_id' => $openId, 'order_status' => OrderModel::ORDER_NOT_PAY, 'beautician_id' => $beauticianId, 'appointment_day' => $appointmentDay, 'appointment_start_time' => $startTime, 'appointment_end_time' => $endTime, 'user_name' => $userName, 'phone_number' => $phoneNumber, 'use_coupon_id' => $couponId, 'use_coupon_code' => $couponCode);
     // 事务开始
     $this->db->trans_start();
     // 设置优惠券已使用
     if ($couponId && $project['can_use_coupon']) {
         $customerCouponModel->useCoupon($couponId, $openId);
     } else {
         if ($couponCode && $project['can_use_coupon_code']) {
             $couponCodeModel->addUseTimes($couponCode);
         } else {
         }
     }
     $insertOrderNo = (new CurdUtil($orderModel))->create($orderData);
     if ($insertOrderNo) {
         $orderProjectData = array('order_id' => $insertOrderNo, 'project_id' => $project['project_id'], 'project_use_time' => $project['use_time'], 'project_price' => $project['price'], 'create_time' => DateUtil::now(), 'project_name' => $project['project_name'], 'project_cover' => $project['project_cover']);
     } else {
         $this->message('提交订单失败,请重试!');
     }
     (new CurdUtil($orderProjectModel))->create($orderProjectData);
     $this->db->trans_complete();
     if ($this->db->trans_status() === FALSE) {
         $this->db->trans_rollback();
         $this->message('提交订单失败,请重试!');
     } else {
         $this->db->trans_commit();
         // 清空购物车
         (new CartUtil())->emptyCart();
         // 跳到 订单显示
         ResponseUtil::redirect(UrlUtil::createUrl('order/pay/' . $orderNo));
     }
 }
开发者ID:guohao214,项目名称:xinya,代码行数:101,代码来源:Cart.php


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