本文整理匯總了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) . '/>';
}
示例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;
}
示例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;
}
}
示例4: logout
function logout()
{
header('Location: ' . url::root());
exit;
}
示例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;
?>
示例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);
}
示例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)];
}
示例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;
}
示例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];
}
示例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>
示例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;
}