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


PHP Loader::getRootURL方法代码示例

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


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

示例1: set_body_data

 protected function set_body_data()
 {
     $this->set_body('body_view', 'Resume');
     $resumePath = Loader::getRootURL('portfolio') . "/jsonresume/{$this->resume}";
     $resume = file_get_contents($resumePath);
     $resume = json_decode($resume, true);
     $this->set_body('body_data', $resume);
     parent::set_body_data();
 }
开发者ID:jacobemerick,项目名称:web,代码行数:9,代码来源:ResumeController.class.inc.php

示例2: get_menu

 protected function get_menu()
 {
     $menu = [['name' => 'About', 'link' => Loader::getRootURL()], ['name' => 'Projects', 'link' => Loader::getRootURL() . 'projects/'], ['name' => 'Résumé', 'link' => Loader::getRootURL() . 'resume/'], ['name' => 'Contact', 'link' => Loader::getRootURL() . 'contact/']];
     if (!URLDecode::getPiece(1)) {
         $active_page = 'About';
     } else {
         $active_page = ucfirst(URLDecode::getPiece(1));
     }
     return array_map(function ($row) use($active_page) {
         $row = (object) $row;
         $row->active = $row->name == $active_page;
         return $row;
     }, $menu);
 }
开发者ID:jacobemerick,项目名称:web,代码行数:14,代码来源:DefaultPageController.class.inc.php

示例3: get_thumb

 private function get_thumb($string, $is_absolute, $size)
 {
     list($category, $file_name) = explode('/', $string);
     list($photo, $extension) = explode('.', $file_name);
     $file_path = $this->get_file_path($category, $photo, $size, $extension);
     $file_size = getimagesize($file_path);
     Loader::load('collector', 'image/PhotoCollector');
     $photo_result = PhotoCollector::fetchRow($category, $photo);
     if ($photo_result == false) {
         return '';
     }
     $height = $file_size[1];
     $width = $file_size[0];
     $description = $photo_result->description;
     $domain = '/';
     if ($is_absolute) {
         $domain = Loader::getRootURL(URLDecode::getSite());
     }
     return sprintf(self::$IMAGE_NODE, $domain, $category, $photo, $size, $extension, $height, $width, $description);
 }
开发者ID:jacobemerick,项目名称:web,代码行数:20,代码来源:FetchFirstPhotoContent.class.inc.php

示例4: if

<div id="top">
	<h1><a href="<?php 
echo Loader::getRootURL();
?>
">About</a><? if(isset($title)) : ?> <span>/</span> <?php 
echo $title;
?>
<? endif ?></h1>
</div>
开发者ID:jacobemerick,项目名称:web,代码行数:9,代码来源:Top.tpl.php

示例5: get_log_introduction

 private function get_log_introduction($log)
 {
     return array(
         'title' => $log->title,
         'url' => Loader::getRootURL('waterfalls') . self::$JOURNAL_DIRECTORY . '/' . $log->alias . '/',
         'date' => $this->get_parsed_date($log->date),
         'publish_date' => $this->get_parsed_date($log->publish_date),
         'introduction' => $log->introduction,
         'image' => sprintf(
             self::$MEDIUM_IMAGE_NODE,
             $log->image_category,
             $log->image_name,
             $log->image_description),
         'author' => self::$AUTHOR,
         'author_url' => self::$AUTHOR_URL,
     );
 }
开发者ID:jacobemerick,项目名称:web,代码行数:17,代码来源:LogController.class.inc.php

示例6: get_link

	private function get_link($string, $is_absolute, $anchor = '')
	{
		list($type, $uri) = explode('/', $string, 2);
		
		$link = '';
		
		switch($type)
		{
			case 'blog' :
        global $container;
        $repository = new Jacobemerick\Web\Domain\Blog\Post\MysqlPostRepository($container['db_connection_locator']);
        $post = $repository->findPostByPath($uri);

				if($post === NULL)
					return;
				
				$link .= ($is_absolute) ? Loader::getRootURL('blog') : '/';
				$link .= "{$post['category']}/{$post['path']}/";
				
				if($anchor == '')
					$anchor = $post['title'];
				
				break;
			case 'blog-tag' :
				$link .= ($is_absolute) ? Loader::getRootURL('blog') : '/';
				$link .= "tag/{$uri}/";
				
				if($anchor == '')
				{
					$anchor = $uri;
					$anchor = str_replace('-', ' ', $anchor);
					$anchor = ucwords($anchor);
				}
				
				break;
			case 'journal' :
				Loader::load('collector', 'waterfall/LogCollector');
				$log = LogCollector::getByAlias($uri);
				
				if($log === NULL)
					return;
				
				$link .= ($is_absolute) ? Loader::getRootURL('waterfalls') : '/';
				$link .= "journal/{$log->alias}/";
				
				if($anchor == '')
					$anchor = $log->title;
				
				break;
			case 'falls' :
                $pieces = explode('/', $uri);
                if (count($pieces) == 1) {
                    Loader::load('collector', 'waterfall/WatercourseCollector');
                    list ($watercourse_alias) = $pieces;
                    $watercourse = WatercourseCollector::getByAlias($watercourse_alias);
                    
                    if ($watercourse == null) {
                        return;
                    }
                    
                    $link .= ($is_absolute) ? Loader::getRootURL('waterfalls') : '/';
                    $link .= "{$watercourse->alias}/";
                    
                    if ($anchor == '') {
                        $anchor = $watercourse->name;
                    }
                } else if (count($pieces) == 2) {
                    Loader::load('collector', 'waterfall/WaterfallCollector');
                    list ($watercourse_alias, $waterfall_alias) = $pieces;
                    $waterfall = WaterfallCollector::getByAlias($watercourse_alias, $waterfall_alias);
                    
                    if ($waterfall == null) {
                        return;
                    }
                    
                    $link .= ($is_absolute) ? Loader::getRootURL('waterfalls') : '/';
                    $link .= "{$waterfall->watercourse_alias}/{$waterfall->alias}/";
                    
                    if ($anchor == '') {
                        $anchor = $waterfall->name;
                    }
                }
				break;
			default :
				break;
		}
		
		return sprintf(self::$LINK_CONTENT, $link, $anchor);
	}
开发者ID:jacobemerick,项目名称:web,代码行数:89,代码来源:FixInternalLinkContent.class.inc.php


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