本文整理汇总了PHP中Loader::getRootUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP Loader::getRootUrl方法的具体用法?PHP Loader::getRootUrl怎么用?PHP Loader::getRootUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Loader
的用法示例。
在下文中一共展示了Loader::getRootUrl方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_recent_posts
private function get_recent_posts()
{
global $container;
$postRepository = new MysqlPostRepository($container['db_connection_locator']);
$recentPosts = $postRepository->getActivePosts(3);
$recent_post_array = array();
foreach ($recentPosts as $postResult) {
$post = new stdclass();
$post->title = $postResult['title'];
$post->url = Loader::getRootUrl('blog') . "{$postResult['category']}/{$postResult['path']}/";
$post->category = ucwords(str_replace('-', ' ', $postResult['category']));
$post->thumb = Content::instance('FetchFirstPhoto', $postResult['body'])->activate();
$post->body = Content::instance('SmartTrim', $postResult['body'])->activate($post->thumb !== '' ? self::$POST_LENGTH_SHORT : self::$POST_LENGTH_LONG);
$recent_post_array[] = $post;
}
return $recent_post_array;
}
示例2: expand_post
protected function expand_post($raw_post, $format = 'short')
{
$post = [
'type' => $raw_post['type'],
'title' => ($format == 'short') ? $raw_post['message'] : $raw_post['message_long'],
'date' => $this->get_parsed_date($raw_post['datetime']),
];
if ($format != 'short') {
$post['url'] = Loader::getRootUrl('lifestream') . "{$raw_post['type']}/{$raw_post['id']}/";
$metadata = json_decode($raw_post['metadata'], true);
$post = array_merge($post, $metadata);
}
return (object) $post;
}
示例3: __construct
public function __construct()
{
parent::__construct();
$log_path = URLDecode::getPiece(2);
$this->log = LogCollector::getByAlias($log_path);
if(!$this->log)
$this->eject();
$this->parent_navigation_item = 'journal';
$this->handle_comment_submit(
self::$WATERFALL_SITE_ID,
$this->log->alias,
Loader::getRootUrl('waterfalls') . self::$JOURNAL_DIRECTORY . '/' . $this->log->alias . '/',
$this->log->title);
$this->add_waterfall_js();
}
示例4: __construct
public function __construct()
{
parent::__construct();
$path_watercourse = URLDecode::getPiece(1);
$path_fall = URLDecode::getPiece(2);
$this->waterfall = WaterfallCollector::getByAlias($path_watercourse, $path_fall);
if (!$this->waterfall) {
$this->eject();
}
$this->handle_comment_submit(
self::$WATERFALL_SITE_ID,
"{$this->waterfall->watercourse_alias}/{$this->waterfall->alias}",
Loader::getRootUrl('waterfalls') . "{$this->waterfall->watercourse_alias}/{$this->waterfall->alias}/",
$this->waterfall->name);
$this->add_waterfall_js();
}
示例5: get_photo_content
private function get_photo_content($string, $size, $is_absolute)
{
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('blog');
}
return sprintf(self::$PHOTO_CONTENT, $domain, $category, $photo, $size, $height, $width, $description, $description);
}
示例6: get_list_prev_link
protected function get_list_prev_link()
{
if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count())
return;
return Loader::getRootUrl('lifestream') . $this->tag . '/page/' . ($this->page + 1) . '/';
}
示例7: get_related_posts
private function get_related_posts()
{
$tag_array = array();
foreach($this->tags as $tag)
{
$tag_array[] = $tag['id'];
}
$series_posts = $this->fetch_series_posts();
$exclude_post_array = array();
foreach($series_posts as $series_post)
{
$exclude_post_array[] = $series_post['post'];
}
global $container;
$repository = new Jacobemerick\Web\Domain\Blog\Post\MysqlPostRepository($container['db_connection_locator']);
$post_result = $repository->getActivePostsByRelatedTags($this->post['id']);
$post_array = array();
foreach($post_result as $post_row)
{
$post = new stdclass();
$post->title = $post_row['title'];
$post->url = Loader::getRootUrl('blog') . "{$post_row['category']}/{$post_row['path']}/";
$post->category = ucwords(str_replace('-', ' ', $post_row['category']));
$post->thumb = Content::instance('FetchFirstPhoto', $post_row['body'])->activate();
$post->body = Content::instance('SmartTrim', $post_row['body'])->activate(($post->thumb !== '') ? self::$POST_LENGTH_SHORT : self::$POST_LENGTH_LONG);
$post_array[] = $post;
}
return $post_array;
}