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


PHP TBGContext::getStrippedTBGPath方法代码示例

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


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

示例1: url

			}
			/* next rows of buttons */
			.markItUpHeader ul ul {
				display:none;
				position:absolute;
				top:18px; left:0px;	
				background:#FFF;
				border:1px solid #000;
			}
			.markItUpHeader ul ul li {
				float:none;
				border-bottom:1px solid #000;
			}
			.markItUpHeader ul ul .markItUpDropMenu {
				background:#FFF url(<?php 
echo TBGSettings::getURLhost() . TBGContext::getStrippedTBGPath() . '/themes/' . TBGSettings::getThemeName() . '/markitup/';
?>
submenu.png) no-repeat 100% 50%;
			}
			.markItUpHeader ul .markItUpSeparator {
				margin:0 10px;
				width:1px;
				height:16px;
				overflow:hidden;
				background-color:#CCC;
			}
			.markItUpHeader ul ul .markItUpSeparator {
				width:auto; height:1px;
				margin:0px;
			}
			/* next rows of buttons */
开发者ID:ronaldbroens,项目名称:thebuggenie,代码行数:31,代码来源:header.inc.php

示例2: generate

 /**
  * Generate a url based on a route
  * 
  * @param string $name The route key
  * @param array $params key=>value pairs of route parameters
  * @param boolean $relative Whether to generate an url relative to web root or an absolute 
  * 
  * @return string
  */
 public function generate($name, $params = array(), $relative = true, $querydiv = '/', $divider = '/', $equals = '/')
 {
     if (mb_substr($name, 0, 1) == '@') {
         $name = mb_substr($name, 1);
         $details = explode('?', $name);
         $name = array_shift($details);
         if (count($details)) {
             $param_details = array_shift($details);
             $param_details = explode('&', $param_details);
             foreach ($param_details as $detail) {
                 $param_detail = explode('=', $detail);
                 if (count($param_detail) > 1) {
                     $params[$param_detail[0]] = $param_detail[1];
                 }
             }
         }
     }
     if (!isset($this->routes[$name])) {
         TBGLogging::log("The route '{$name}' does not exist", 'routing', TBGLogging::LEVEL_FATAL);
         throw new Exception("The route '{$name}' does not exist");
     }
     list($url, $regexp, $names, $names_hash, $action, $module, $defaults, $csrf_enabled) = $this->routes[$name];
     $defaults = array('action' => $action, 'module' => $module);
     // all params must be given
     foreach ($names as $tmp) {
         if (!isset($params[$tmp]) && !isset($defaults[$tmp])) {
             throw new Exception(sprintf('Route named "%s" have a mandatory "%s" parameter', $name, $tmp));
         }
     }
     $params = self::arrayDeepMerge($defaults, $params);
     if ($csrf_enabled) {
         $params['csrf_token'] = TBGContext::generateCSRFtoken();
     }
     // in PHP 5.5, preg_replace with /e modifier is deprecated; preg_replace_callback is recommended
     $callback = function ($matches) use($params) {
         return array_key_exists($matches[1], $params) ? urlencode($params[$matches[1]]) : $matches[0];
     };
     $real_url = preg_replace_callback('/\\:([^\\/]+)/', $callback, $url);
     // we add all other params if *
     if (mb_strpos($real_url, '*')) {
         $tmp = array();
         foreach ($params as $key => $value) {
             if (isset($names_hash[$key]) || isset($defaults[$key])) {
                 continue;
             }
             if (is_array($value)) {
                 foreach ($value as $k => $v) {
                     if (is_array($v)) {
                         foreach ($v as $vk => $vv) {
                             if (is_array($vv)) {
                                 foreach ($vv as $vvk => $vvv) {
                                     $tmp[] = "{$key}[{$k}][{$vk}][{$vvk}]" . $equals . urlencode($vvv);
                                 }
                             } else {
                                 $tmp[] = "{$key}[{$k}][{$vk}]" . $equals . urlencode($vv);
                             }
                         }
                     } else {
                         $tmp[] = "{$key}[{$k}]" . $equals . urlencode($v);
                     }
                 }
             } else {
                 $tmp[] = urlencode($key) . $equals . urlencode($value);
             }
         }
         $tmp = implode($divider, $tmp);
         if (mb_strlen($tmp) > 0) {
             $tmp = $querydiv . $tmp;
         }
         $real_url = preg_replace('/\\/\\*(\\/|$)/', "{$tmp}\$1", $real_url);
     }
     // strip off last divider character
     if (mb_strlen($real_url) > 1) {
         $real_url = rtrim($real_url, $divider);
     }
     if (!$relative) {
         return TBGContext::getURLhost() . TBGContext::getStrippedTBGPath() . $real_url;
     }
     return TBGContext::getStrippedTBGPath() . $real_url;
 }
开发者ID:oparoz,项目名称:thebuggenie,代码行数:89,代码来源:TBGRouting.class.php


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