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


PHP url::root方法代码示例

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


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

示例1: image

 /**
  * 创建一个超链接传入uri或者完整的url
  *
  * @param string URL或者URI字符串
  * @param array 图片的其它属性
  * @return string 链接字符串
  *
  */
 public static function image($url, $attrs = array())
 {
     //如果不是完整的链接,如:http://www.zotop.com/a/b/1.gif ,则将相对连接处理成绝对链接
     if (strpos($url, '://') === false && $url[0] != '/') {
         $url = url::root() . '/' . $url;
     }
     //解析url中的特殊字符串
     $url = url::decode($url);
     return '<img src="' . $url . '" ' . html::attributes($attrs) . '/>';
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:18,代码来源:html.php

示例2: action_restore

 function action_restore($args)
 {
     global $manager, $tree, $user, $lang;
     /* Decode argumenst */
     $id = array_shift($args);
     if ($user->admin()) {
         $this->_restoreItem($id);
         header("Location: " . url::item($id));
     } else {
         header("Location: " . url::root());
     }
     exit;
 }
开发者ID:KasaiDot,项目名称:Dashboard2,代码行数:13,代码来源:plugin.php

示例3: action_settings

 function action_settings($args)
 {
     global $manager, $tree, $user, $lang;
     /* Get all admins */
     $admins = $manager->adminHandlers;
     /* Sort admins based on position */
     $compare_position = create_function('$a, $b', 'return ($a["position"] == $b["position"]) ? 0 : (($a["position"] < $b["position"]) ? -1 : 1);');
     uasort($admins, $compare_position);
     /* Decode arguments */
     $current = '';
     if (count($args)) {
         $current = array_shift($args);
     }
     if ($current == '' && count($admins)) {
         $current = key($admins);
     }
     reset($admins);
     // Setup template
     $page = new admin();
     // Notify plugins of a PreSkinParse event;
     $data = array('page' => &$page, 'template' => &$page->template, 'type' => 'admin', 'params' => array('action' => 'admin', 'args' => $args));
     $manager->handleEvent('PreSkinParse', $data);
     // Handle authorisation
     $ticket = false;
     if (isset($_REQUEST['ticket'])) {
         if (ticket::authorize($_REQUEST['ticket']) == $current) {
             $ticket = true;
         }
     }
     if ($ticket || $user->root() || $user->admin() && $admins[$current]['public']) {
         $t = new Template($this->getTemplate('tab.template'));
         $t->set('tabs', $admins);
         $t->set('current', $current);
         $page->template->set('tabs', $t->fetch());
         $manager->handleAdmin($current, $data);
         $page->show();
     } else {
         header('Location: ' . url::root());
         exit;
     }
 }
开发者ID:KasaiDot,项目名称:Dashboard2,代码行数:41,代码来源:plugin.php

示例4: logout

 function logout()
 {
     header('Location: ' . url::root());
     exit;
 }
开发者ID:KasaiDot,项目名称:Dashboard2,代码行数:5,代码来源:users.library.php

示例5: gettext

                    <div class="quantite_title"><?php 
echo gettext("Quantity");
?>
</div>
                    <div class="price_title"><?php 
echo gettext("Price");
?>
</div>
                </div>
                <?$ids = array();?>
                <?foreach($order['items'] as $item):?>
                    <?            
                    $ids[] = $item[0]->id;
                    $products = get_object_vars($item[0]);  
                    $product_image = base_url().'public/images/products/70x70/0.jpg';
                    if (is_file(url::root().'public/images/products/70x70/'.$item[0]->id.'.jpg'))  $product_image =  base_url().'public/images/products/70x70/'.$item[0]->id.'.jpg';
                    ?>                
                    <div class="Produit_liste_item" id="<?php 
echo $item[0]->id;
?>
">
                        <div class="suprime"><input type="checkbox" value="<?php 
echo $item[0]->id;
?>
" id="checkbox_<?php 
echo $item[0]->id;
?>
" name="checkbox_supprim[]" /></div>
                        <div class="thumb"><img src="<?php 
echo $product_image;
?>
开发者ID:jabouzi,项目名称:belron,代码行数:31,代码来源:order.php

示例6: abs

 public static function abs($href)
 {
     if (strpos($href, '://') === false) {
         //如果格式如 /system/admin/themes/default/css/system.css
         if ($href[0] === '/') {
             $root = url::root();
             $href = $root . '/' . ltrim($href, $root);
         } else {
             $base = dirname(url::base());
             $href = $base . '/' . $href;
         }
     }
     return url::clean($href);
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:14,代码来源:url.php

示例7: application

 public static function application($id = '', $key = '')
 {
     static $applications = array();
     if (empty($applications)) {
         $applications = zotop::config('zotop.application');
     }
     if (empty($id)) {
         return $applications;
     }
     if (is_array($id)) {
         $applications = array_merge($applications, $id);
         return $applications;
     }
     if (isset($applications[strtolower($id)])) {
         $application = $applications[strtolower($id)];
     }
     if (isset($application)) {
         $application['path'] = ZOTOP . DS . $application['path'];
         $application['url'] = url::root() . '/' . $application['url'];
         $application['base'] = trim($application['url'], '/') . '/' . $application['base'];
         $application['module'] = isset($application['module']) ? $application['module'] : 'zotop';
         $application['controller'] = isset($application['controller']) ? $application['controller'] : 'index';
         $application['action'] = isset($application['action']) ? $application['action'] : 'default';
     }
     if (empty($key)) {
         return $application;
     }
     return $application[strtolower($key)];
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:29,代码来源:zotop.php

示例8: decode

 public static function decode($url)
 {
     $url = strtr($url, array('$root' => url::root(), '$system' => url::system(), '$theme' => url::theme(), '$modules' => url::modules(), '$this' => url::controller(), '$common' => url::common()));
     return $url;
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:5,代码来源:url.php

示例9: application

 public static function application($id = '', $key = '')
 {
     static $applications = array();
     if (empty($applications)) {
         $applications = zotop::config('zotop.application');
     }
     if (empty($id)) {
         return $applications;
     }
     if (is_array($id)) {
         $applications = array_merge($applications, $id);
         return $applications;
     }
     $application = array();
     if (isset($applications[strtolower($id)])) {
         $application = $applications[strtolower($id)];
     }
     if (isset($application)) {
         $application['path'] = ZOTOP . DS . $application['path'];
         $application['url'] = url::root() . '/' . $application['url'];
         $application['base'] = trim($application['url'], '/') . '/' . $application['base'];
     }
     if (empty($key)) {
         return $application;
     }
     return $application[$key];
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:27,代码来源:zotop.php

示例10: gettext

                <ul id="wish_list">                    
                </ul>
                <input type="submit" class="commande" name="confirm_wishlist" onclick="confirm_wishlist(); return false;" value="<?php 
echo gettext("Order now");
?>
" />
            </form>         
            <input type="hidden" value="<?php 
echo $store_id;
?>
" id="store_id">
            </div>            
        </div>        
    </div>    
    
</div>

<? $popup_image = base_url().'public/images/products/250x381/0.jpg';?>
<? if (is_file(url::root().'public/images/products/250x381/'.$prod->id.'.jpg'))  $popup_image = base_url().'public/images/products/250x381/'.$prod->id.'.jpg';?>
<div class="simple_overlay" id="GrandeImage">
<img src="<?php 
echo $popup_image;
?>
" alt="" />
</div>
<script>
$(document).ready(function() {
$("img[rel]").overlay();
});
</script>
开发者ID:jabouzi,项目名称:belron,代码行数:30,代码来源:product.php

示例11: decode

 public static function decode($url)
 {
     $url = str_replace(array('%root%', '%zotop%', '%theme%', '%module%'), array(url::root(), url::zotop(), url::theme(), url::module()), $url);
     return $url;
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:5,代码来源:url.php


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