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


PHP T3Path::getUrl方法代码示例

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


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

示例1: addExtraAssets

 /**
  * Add some other condition assets (css, javascript). Use to parse /etc/assets.xml
  *
  * @return  null
  */
 function addExtraAssets()
 {
     $base = JURI::base(true);
     $regurl = '#(http|https)://([a-zA-Z0-9.]|%[0-9A-Za-z]|/|:[0-9]?)*#iu';
     $afiles = T3Path::getAllPath('etc/assets.xml');
     foreach ($afiles as $afile) {
         if (is_file($afile)) {
             //load xml
             $axml = JFactory::getXML($afile);
             //process if exist
             if ($axml) {
                 foreach ($axml as $node => $nodevalue) {
                     //ignore others node
                     if ($node == 'stylesheets' || $node == 'scripts') {
                         foreach ($nodevalue->file as $file) {
                             $compatible = (string) $file['compatible'];
                             if ($compatible) {
                                 $parts = explode(' ', $compatible);
                                 $operator = '=';
                                 //exact equal to
                                 $operand = $parts[0];
                                 if (count($parts) == 2) {
                                     $operator = $parts[0];
                                     $operand = $parts[1];
                                 }
                                 //compare with Joomla version
                                 if (!version_compare(JVERSION, $operand, $operator)) {
                                     continue;
                                 }
                             }
                             $url = (string) $file;
                             if (substr($url, 0, 2) == '//') {
                                 //external link
                             } else {
                                 if ($url[0] == '/') {
                                     //absolute link from based folder
                                     $url = is_file(JPATH_ROOT . $url) ? $base . $url : false;
                                 } else {
                                     if (!preg_match($regurl, $url)) {
                                         //not match a full url -> sure internal link
                                         $url = T3Path::getUrl($url);
                                         // so get it
                                     }
                                 }
                             }
                             if ($url) {
                                 if ($node == 'stylesheets') {
                                     $type = $file['type'] ? (string) $file['type'] : 'text/css';
                                     $media = $file['media'] ? (string) $file['media'] : null;
                                     $this->addStylesheet($url, $type, $media);
                                 } else {
                                     $type = $file['type'] ? (string) $file['type'] : 'text/javascript';
                                     $defer = $file['defer'] ? (bool) $file['defer'] : false;
                                     $async = $file['async'] ? (bool) $file['async'] : false;
                                     $this->addScript($url, $type, $defer, $async);
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     // template extended styles
     $aparams = $this->_tpl->params->toArray();
     $extras = array();
     $itemid = JFactory::getApplication()->input->get('Itemid');
     foreach ($aparams as $name => $value) {
         if (preg_match('/^theme_extras_(.+)$/', $name, $m)) {
             $extras[$m[1]] = $value;
         }
     }
     if (count($extras)) {
         foreach ($extras as $extra => $pages) {
             if (!is_array($pages) || !count($pages) || in_array(0, $pages)) {
                 continue;
                 // disabled
             }
             if (in_array(-1, $pages) || in_array($itemid, $pages)) {
                 // load this style
                 $this->addCss('extras/' . $extra);
             }
         }
     }
 }
开发者ID:ITPrism,项目名称:GamificationDistribution,代码行数:90,代码来源:template.php

示例2: defined

 * This file may not be redistributed in whole or significant part.
 * ------------------------------------------------------------------------
 */
defined('_JEXEC') or die;
// parse jdoc after render
$params->set('parse-jdoc', 1);
// use with T3
$t3doc = T3::getApp();
$doc = JFactory::getDocument();
// get params
$tplparams = JFactory::getApplication()->getTemplate(true)->params;
$sitename = $tplparams->get('sitename');
$slogan = $tplparams->get('slogan', '');
$logotype = $tplparams->get('logotype', 'text');
$logoimage = $logotype == 'image' ? $tplparams->get('logoimage', T3Path::getUrl('images/logo.png', '', true)) : '';
$logoimgsm = $logotype == 'image' && $tplparams->get('enable_logoimage_sm', 0) ? $tplparams->get('logoimage_sm', T3Path::getUrl('images/logo-sm.png', '', true)) : false;
$logolink = $tplparams->get('logolink');
if (!$sitename) {
    $sitename = JFactory::getConfig()->get('sitename');
}
$headright = $doc->countModules('head-search or languageswitcherload or right-menu') || $tplparams->get('addon_offcanvas_enable');
// get logo url
$logourl = JURI::base(true);
if ($logolink == 'page') {
    $logopageid = $tplparams->get('logolink_id');
    $_item = JFactory::getApplication()->getMenu()->getItem($logopageid);
    if ($_item) {
        $logourl = JRoute::_('index.php?Itemid=' . $logopageid);
    }
}
// Header Params
开发者ID:jamielaff,项目名称:als_projects,代码行数:31,代码来源:style-4.php

示例3: addExtraAssets

 /**
  * Add some other condition assets (css, javascript)
  */
 function addExtraAssets()
 {
     $base = JURI::base(true);
     $regurl = '#(http|https)://([a-zA-Z0-9.]|%[0-9A-Za-z]|/|:[0-9]?)*#iu';
     foreach (array(T3_PATH, T3_TEMPLATE_PATH) as $bpath) {
         //full path
         $afile = $bpath . '/etc/assets.xml';
         if (is_file($afile)) {
             //load xml
             $axml = JFactory::getXML($afile);
             //parse stylesheets first if exist
             if ($axml) {
                 foreach ($axml as $node => $nodevalue) {
                     //ignore others node
                     if ($node == 'stylesheets' || $node == 'scripts') {
                         foreach ($nodevalue->file as $file) {
                             $compatible = $file['compatible'];
                             if ($compatible) {
                                 $parts = explode(' ', $compatible);
                                 $operator = '=';
                                 //exact equal to
                                 $operand = $parts[1];
                                 if (count($parts) == 2) {
                                     $operator = $parts[0];
                                     $operand = $parts[1];
                                 }
                                 //compare with Joomla version
                                 if (!version_compare(JVERSION, $operand, $operator)) {
                                     continue;
                                 }
                             }
                             $url = (string) $file;
                             if (substr($url, 0, 2) == '//') {
                                 //external link
                             } else {
                                 if ($url[0] == '/') {
                                     //absolute link from based folder
                                     $url = is_file(JPATH_ROOT . $url) ? $base . $url : false;
                                 } else {
                                     if (!preg_match($regurl, $url)) {
                                         //not match a full url -> sure internal link
                                         $url = T3Path::getUrl($url);
                                         // so get it
                                     }
                                 }
                             }
                             if ($url) {
                                 if ($node == 'stylesheets') {
                                     $this->addStylesheet($url);
                                 } else {
                                     $this->addScript($url);
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }
开发者ID:GitIPFire,项目名称:Homeworks,代码行数:63,代码来源:template.php

示例4:

?>
;
</script>

<jdoc:include type="head" />

<?php 
if (T3Common::mobile_device_detect() == 'iphone') {
    ?>
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1; user-scalable=1;" />
<meta name="apple-touch-fullscreen" content="YES" />
<?php 
}
?>

<?php 
if (T3Common::mobile_device_detect()) {
    ?>
<meta name="HandheldFriendly" content="true" />
<?php 
}
?>

<link href="<?php 
echo T3Path::getUrl('images/favicon.ico');
?>
" rel="shortcut icon" type="image/x-icon" />

<?php 
JHTML::stylesheet('templates/system/css/system.css');
JHTML::stylesheet('templates/system/css/general.css');
开发者ID:ashanrupasinghe,项目名称:slbcv2,代码行数:31,代码来源:head.php

示例5:

Setting for this message. Clear cookie if you change this setting.
'none': Not show warning
'once': Show one time only
'close': Show until user check box "Not show again" and close the message
'always': Always show this message
*/
if (!SHOW_IE6_WARNING || SHOW_IE6_WARNING == 'none') {
    return;
}
$this->addParamCookie('ie6w_notshowagain');
if (SHOW_IE6_WARNING != 'always' && $this->getParam('ie6w_notshowagain', 0)) {
    return;
}
?>
<link rel="stylesheet" href="<?php 
echo T3Path::getUrl("blocks/ie6/ie6warning.css");
?>
" type="text/css" />
<div style="" id="ie6-warning" class="wrap">
	<div class="main"><div class="inner clearfix">	
		
		<p class="note"><img src="plugins/system/jat3/base-themes/default/blocks/ie6/note.png" title="" alt="" align="left" /></p>
		<ul>
			<li><a class="firefox-download" href="http://www.mozilla.com/firefox/" target="_blank" title="Download Firefox">&nbsp;</a></li>
			<li><a class="chrome-download" href="http://www.google.com/chrome" target="_blank" title="Download Chrome">&nbsp;</a></li>
			<li><a class="safari-download" href="http://www.apple.com/safari/download/" target="_blank" title="Download Safari">&nbsp;</a></li>
			<li><a class="opera-download" href="http://www.opera.com/download/" target="_blank" title="Download Opera">&nbsp;</a></li>
			<li><a class="ie-download" href="http://www.microsoft.com/windows/Internet-explorer/default.aspx" target="_blank" title="Download Internet Explorer 8 NOW!">&nbsp;</a></li>
		</ul>
		
		<div class="close">
开发者ID:rlee1962,项目名称:diylegalcenter,代码行数:31,代码来源:ie6warning.php

示例6: defined

<?php

/**
 * @package   T3 Blank
 * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license   GNU General Public License version 2 or later; see LICENSE.txt
 */
defined('_JEXEC') or die;
// get params
$sitename = $this->params->get('sitename');
$slogan = $this->params->get('slogan', '');
$logotype = $this->params->get('logofootertype', 'text');
$logoimage = $logotype == 'image' ? $this->params->get('logofooterimage', T3Path::getUrl('images/logo.png', '', true)) : '';
if (!$sitename) {
    $sitename = JFactory::getConfig()->get('sitename');
}
?>

<!-- FOOTER -->
<footer id="t3-footer" class="wrap t3-footer">
  <!-- LOGO -->
  <div class="logo">
    <div class="logo-<?php 
echo $logotype, '' ? ' logo-control' : '';
?>
">
      <a href="<?php 
echo JURI::base(true);
?>
" title="<?php 
echo strip_tags($sitename);
开发者ID:ForAEdesWeb,项目名称:AEW25,代码行数:31,代码来源:footer.php

示例7:

    <?php 
    if (is_dir(T3Path::path('layoutinfo', true))) {
        ?>
        <link type="text/css" rel="stylesheet" href="<?php 
        echo T3Path::url('layoutinfo/style.css', true);
        ?>
" />
        <script type="text/javascript" src="<?php 
        echo T3Path::url('layoutinfo/script.js', true);
        ?>
"></script>
    <?php 
    } else {
        ?>
        <?php 
        if (T3Path::getPath('layoutinfo')) {
            ?>
        <link type="text/css" rel="stylesheet" href="<?php 
            echo T3Path::getUrl('layoutinfo/style.css');
            ?>
" />
        <script type="text/javascript" src="<?php 
            echo T3Path::getUrl('layoutinfo/script.js');
            ?>
"></script>
        <?php 
        }
        ?>
    <?php 
    }
}
开发者ID:ashanrupasinghe,项目名称:slbcv2,代码行数:31,代码来源:debug.php


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