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


PHP IUrl::getHost方法代码示例

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


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

示例1: __construct

 /**
  * @brief 构造函数
  * @param $payment_id 支付方式ID
  */
 public function __construct($payment_id)
 {
     //回调函数地址
     $this->callbackUrl = IUrl::getHost() . IUrl::creatUrl("/block/callback/_id/" . $payment_id);
     //回调业务处理地址
     $this->serverCallbackUrl = IUrl::getHost() . IUrl::creatUrl("/block/server_callback/_id/" . $payment_id);
 }
开发者ID:zhendeguoke1008,项目名称:shop,代码行数:11,代码来源:paymentplugin.php

示例2: seo_items

 public function seo_items($item)
 {
     $weburl = IUrl::getHost() . IUrl::creatUrl("");
     switch ($item) {
         case 'goods':
             $query = new IQuery('goods');
             $url = '/site/products/id/';
             $query->fields = "concat('{$url}',id) as loc,DATE_FORMAT(create_time,'%Y-%m-%d') as lastmod";
             $items = $query->find();
             //对url进行处理
             foreach ($items as $key => $val) {
                 $items[$key]['loc'] = IUrl::getHost() . IUrl::creatUrl($val['loc']);
             }
             SiteMaps::create_map($items, 'sitemap_goods.xml', $weburl . 'sitemaps.xsl');
             break;
         case 'article':
             $query = new IQuery('article');
             $url = '/site/article_detail/id/';
             $query->fields = "concat('{$url}',id) as loc,DATE_FORMAT(create_time,'%Y-%m-%d') as lastmod";
             $items = $query->find();
             //对url进行处理
             foreach ($items as $key => $val) {
                 $items[$key]['loc'] = IUrl::getHost() . IUrl::creatUrl($val['loc']);
             }
             SiteMaps::create_map($items, 'sitemap_article.xml', $weburl . 'sitemaps.xsl');
     }
 }
开发者ID:yongge666,项目名称:sunupedu,代码行数:27,代码来源:tools.php

示例3: getAuthorize

 /**
  * 获取版权信息,存储到缓存中进行比对
  * @return boolean
  */
 public static function getAuthorize()
 {
     $iwebshopAuthorize = ISafe::get('iwebshopAuthorize');
     if ($iwebshopAuthorize === null) {
         $return = self::send('_c=system&_a=authorize&host=' . IUrl::getHost());
         $iwebshopAuthorize = isset($return['success']) && $return['success'] == 1 ? true : false;
         ISafe::set('iwebshopAuthorize', $iwebshopAuthorize);
     }
     return $iwebshopAuthorize;
 }
开发者ID:zhendeguoke1008,项目名称:shop,代码行数:14,代码来源:proxy.php

示例4: __construct

 /**
  * @brief 构造函数
  */
 public function __construct()
 {
     $payName = str_replace('pay_', '', get_class($this));
     //获取域名地址
     $sUrl = IUrl::getHost() . IUrl::creatUrl();
     $sUrl = str_replace('plugins/', '', $sUrl);
     //回调函数地址
     $this->callbackUrl = str_replace('plugins/', '', IUrl::getHost() . IUrl::creatUrl("/block/callback/payment_name/{$payName}"));
     //回调业务处理地址
     $this->serverCallbackUrl = str_replace('plugins/', '', IUrl::getHost() . IUrl::creatUrl("/block/server_callback/payment_name/{$payName}"));
 }
开发者ID:chenyongze,项目名称:iwebshop,代码行数:14,代码来源:paymentplugin.php

示例5: seo_items

 public function seo_items($item)
 {
     $weburl = IUrl::getHost() . IUrl::creatUrl("");
     switch ($item) {
         case 'blist':
             $query = new IQuery('brand');
             $query->fields = "id";
             $items = $query->find();
             $lastmod = date('Y-m-d');
             //对url进行处理
             foreach ($items as $key => $val) {
                 $items[$key]['loc'] = IUrl::getHost() . '/blist/' . $val['id'] . '.html';
                 $items[$key]['lastmod'] = $lastmod;
             }
             SiteMaps::create_map($items, 'sitemap_blist.xml', $weburl . 'sitemaps.xsl');
         case 'glist':
             $lastmod = date('Y-m-d');
             // 获取二级类
             $categoryObj = new IModel('category');
             // 获取前四个分类
             $sql = "SELECT id,name,parent_id FROM {$this->tablePre}category WHERE parent_id IN (SELECT id FROM {$this->tablePre}category WHERE parent_id=-1 ) ";
             $items = $categoryObj->query_sql($sql);
             //对url进行处理
             foreach ($items as $key => $val) {
                 $items[$key]['loc'] = IUrl::getHost() . '/glist/' . $val['parent_id'] . '_' . $val['id'] . '.html';
                 $items[$key]['lastmod'] = $lastmod;
             }
             SiteMaps::create_map($items, 'sitemap_glist.xml', $weburl . 'sitemaps.xsl');
         case 'article':
             $lastmod = date('Y-m-d');
             // 获取二级类
             $categoryObj = new IModel('category');
             // 获取前四个分类
             $sql = "SELECT id FROM {$this->tablePre}article WHERE 1 ";
             $items = $categoryObj->query_sql($sql);
             //对url进行处理
             foreach ($items as $key => $val) {
                 $items[$key]['loc'] = IUrl::getHost() . '/article/' . $val['id'] . '.html';
                 $items[$key]['lastmod'] = $lastmod;
             }
             SiteMaps::create_map($items, 'sitemap_article.xml', $weburl . 'sitemaps.xsl');
     }
 }
开发者ID:Wen1750686723,项目名称:utao,代码行数:43,代码来源:tools.php

示例6: notify_send

 /**
  * @brief 发送到货通知邮件
  */
 function notify_send()
 {
     $smtp = new SendMail();
     $error = $smtp->getError();
     if ($error) {
         $return = array('isError' => true, 'message' => $error);
         echo JSON::encode($return);
         exit;
     }
     $notify_ids = IFilter::act(IReq::get('notifyid'));
     $message = '';
     if ($notify_ids && is_array($notify_ids)) {
         $ids = join(',', $notify_ids);
         $query = new IQuery("notify_registry as notify");
         $query->join = "right join goods as goods on notify.goods_id=goods.id left join user as u on notify.user_id = u.id";
         $query->fields = "notify.*,u.username,goods.name as goods_name,goods.store_nums";
         $query->where = "notify.id in(" . $ids . ")";
         $items = $query->find();
         //库存大于0,且处于未发送状态的 发送通知
         $succeed = 0;
         $failed = 0;
         $tb_notify_registry = new IModel('notify_registry');
         foreach ($items as $value) {
             $body = mailTemplate::notify(array('{goodsName}' => $value['goods_name'], '{url}' => IUrl::getHost() . IUrl::creatUrl('/site/products/id/' . $value['goods_id'])));
             $status = $smtp->send($value['email'], "到货通知", $body);
             if ($status) {
                 //发送成功
                 $succeed++;
                 $data = array('notify_time' => ITime::getDateTime(), 'notify_status' => '1');
                 $tb_notify_registry->setData($data);
                 $tb_notify_registry->update('id=' . $value['id']);
             } else {
                 //发送失败
                 $failed++;
             }
         }
     }
     $return = array('isError' => false, 'count' => count($items), 'succeed' => $succeed, 'failed' => $failed);
     echo JSON::encode($return);
 }
开发者ID:yongge666,项目名称:sunupedu,代码行数:43,代码来源:message.php

示例7: do_find_password

 function do_find_password()
 {
     $username = IReq::get('username');
     if ($username === null || !Util::is_username($username)) {
         die("请输入正确的用户名");
     }
     $useremail = IReq::get("useremail");
     if ($useremail === null || !IValidate::email($useremail)) {
         die("请输入正确的邮箱地址");
     }
     $captcha = IReq::get("captcha");
     if ($captcha != ISafe::get('Captcha')) {
         die('验证码输入不正确');
     }
     $tb_user = new IModel("user");
     $username = IFilter::act($username);
     $useremail = IFilter::act($useremail);
     $user = $tb_user->query("username='{$username}' AND email='{$useremail}'");
     if (!$user) {
         die("没有这个用户");
     }
     $user = end($user);
     $hash = IHash::md5(microtime(true) . mt_rand());
     $tb_find_password = new IModel("find_password");
     //重新生成
     $tb_find_password->setData(array('hash' => $hash, 'user_id' => $user['id'], 'addtime' => time()));
     $sendMail = true;
     if ($tb_find_password->query("`hash` = '{$hash}'") || $tb_find_password->add()) {
         $smtp = new SendMail();
         $url = IUrl::creatUrl("/simple/restore_password/hash/{$hash}");
         $url = IUrl::getHost() . $url;
         $content = "请你点击下面这个链接修改密码:<a href='{$url}'>{$url}</a>。<br />如果不能点击,请您把它复制到地址栏中打开。<br />本链接在3天后将自动失效。";
         $re = $smtp->send($user['email'], "您的密码找回", $content);
         if ($re === false) {
             die("发信失败");
         }
         die("success");
     }
     die("找回密码失败");
 }
开发者ID:Wen1750686723,项目名称:utao,代码行数:40,代码来源:simple.php

示例8: __get

 public function __get($parms)
 {
     if ($parms == 'submitUrl') {
         return IUrl::getHost() . IUrl::creatUrl('/ucenter/payment_balance');
     }
 }
开发者ID:chenyongze,项目名称:iwebshop,代码行数:6,代码来源:pay_balance.php

示例9: getCallbackUrl

 public function getCallbackUrl()
 {
     return IUrl::getHost() . IUrl::creatUrl("/ucenter/order");
 }
开发者ID:yongge666,项目名称:sunupedu,代码行数:4,代码来源:paypal.php

示例10: getReturnUrl

 protected function getReturnUrl()
 {
     return IUrl::getHost() . IUrl::creatUrl() . urlencode('index.php?controller=simple&action=oauth_callback');
 }
开发者ID:Wen1750686723,项目名称:utao,代码行数:4,代码来源:oauthbase.php

示例11: send_check_mail

 /**
  * @brief 发送验证邮箱邮件
  */
 public function send_check_mail()
 {
     $email = IReq::get('email');
     if (IValidate::email($email) == false) {
         IError::show(403, '邮件格式错误');
     }
     $userDB = new IModel('user');
     $userRow = $userDB->getObj('email = "' . $email . '"');
     $code = base64_encode($userRow['email'] . "|" . $userRow['id']);
     $url = IUrl::getHost() . IUrl::creatUrl("/simple/check_mail/code/{$code}");
     $content = mailTemplate::checkMail(array("{url}" => $url));
     //发送邮件
     $smtp = new SendMail();
     $result = $smtp->send($email, "用户注册邮箱验证", $content);
     if ($result === false) {
         IError::show(403, "发信失败,请重试!或者联系管理员查看邮件服务是否开启");
     }
     $message = "您的邮箱验证邮件已发送到{$email}!请到您的邮箱中去激活";
     $this->redirect('/site/success?message=' . urlencode($message) . '&email=' . $email);
 }
开发者ID:yongge666,项目名称:sunupedu,代码行数:23,代码来源:simple+-6-29.php

示例12: getSubmitUrl

 /**
  * @see paymentplugin::getSubmitUrl()
  */
 public function getSubmitUrl()
 {
     return IUrl::getHost() . IUrl::creatUrl('/ucenter/payment_balance');
 }
开发者ID:yongge666,项目名称:sunupedu,代码行数:7,代码来源:balance.php

示例13:

				<colgroup>
					<col width="150px" />
					<col />
				</colgroup>
				<tr>
					<th>微商城帮助:</th>
					<td>
						<a href='http://www.aircheng.com' target='_blank'>不知道如何配置?</a>
					</td>
				</tr>

				<tr>
					<th>URL(服务器地址):</th>
					<td>
						<span class="orange"><?php 
echo IUrl::getHost();
echo IUrl::creatUrl("/block/wechat");
?>
</span>
						<label>复制到<微信公众平台后台-开发者中心>URL(服务器地址)</label>
					</td>
				</tr>
				<tr>
					<th>Token(令牌):</th>
					<td>
						<input type='text' class='normal' name='wechat_Token' pattern='required' alt='公众号Token必须填写'  />
						<label>把填写Token(令牌)复制到<微信公众平台后台-开发者中心>的Token中,必须保持两边一致</label>
					</td>
				</tr>
				<tr>
					<th>AppID:</th>
开发者ID:yongge666,项目名称:sunupedu,代码行数:31,代码来源:wechat.php

示例14: setHost

 /**
  * @param string $pattern
  * @param IUrl $url
  * @param string $key
  *
  * @return string
  */
 protected function setHost($pattern, IUrl $url, $key = ':host')
 {
     $host = $url->getHost();
     $pattern = s($pattern, [$key => $host]);
     return $pattern;
 }
开发者ID:weew,项目名称:url,代码行数:13,代码来源:UrlBuilder.php

示例15: doPay

 /**
  * @see paymentplugin::doPay()
  */
 public function doPay($sendData)
 {
     //是否选择了银行
     if (isset($sendData['defaultbank']) && $sendData['defaultbank']) {
         parent::doPay($sendData);
     } else {
         $bankList = array('ABC' => '中国农业银行', 'ICBCB2C' => '中国工商银行', 'CCB' => '中国建设银行', 'SPDB' => '上海浦东发展银行', 'BOCB2C' => '中国银行', 'CMB' => '招商银行', 'CIB' => '兴业银行', 'GDB' => '广发银行', 'CMBC' => '中国民生银行', 'CEB' => '中国光大银行', 'SPABANK' => '平安银行', 'POSTGC' => '中国邮政储蓄银行', 'COMM' => '交通银行', 'BJBANK' => '北京银行');
         $paramArray = array_merge($_POST, $_GET);
         unset($paramArray['controller'], $paramArray['action']);
         $urlParam = http_build_query($paramArray);
         $postUrl = IUrl::getHost() . IUrl::creatUrl('/block/doPay?' . $urlParam);
         $urlPath = IUrl::creatUrl() . 'plugins/payments/pay_bank_alipay/banklogo';
         include dirname(__FILE__) . '/template/selectBank.php';
     }
 }
开发者ID:xzdesk,项目名称:iwebshop.com,代码行数:18,代码来源:bank_alipay.php


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