本文整理汇总了PHP中Uri::url_array方法的典型用法代码示例。如果您正苦于以下问题:PHP Uri::url_array方法的具体用法?PHP Uri::url_array怎么用?PHP Uri::url_array使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Uri
的用法示例。
在下文中一共展示了Uri::url_array方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _index
public function _index($newsletter, $sub_tool = FALSE)
{
# this is a hack for allowed sub_tools only.
if (!is_object($newsletter)) {
$newsletter = ORM::factory('newsletter')->where('fk_site', $this->site_id)->find($newsletter);
if (FALSE === $newsletter->loaded) {
return $this->wrap_tool('newsletter error, please contact support', 'album', $album);
}
}
$url_array = Uri::url_array();
$page_name = $this->get_page_name($url_array['0'], 'newsletter', $newsletter->id);
$data = $url_array['2'];
$action = empty($_GET['action']) ? 'index' : $_GET['action'];
switch ($action) {
case 'index':
$view = self::form_handler($page_name, $newsletter);
break;
case 'add':
$view = self::add($page_name, $newsletter->id, $data);
break;
default:
die("{$page_name} : {$action} : trigger 404 not found");
}
# get the custom javascript;
# $view->global_readyJS(self::javascripts());
return $this->wrap_tool($view, 'newsletter', $newsletter);
}
示例2: _index
public function _index($review)
{
$url_array = Uri::url_array();
$page_name = $this->get_page_name($url_array['0'], 'review', $review->id);
$data = $url_array['2'];
$view = self::show_list($page_name, $review);
if ($_POST) {
$add_handler = self::post_review($page_name, $review->id);
} else {
$add_handler = new View('public_review/reviews/add_form');
$add_handler->page_name = $page_name;
$add_handler->values = array('body' => '', 'name' => '', 'email' => '');
}
$view->add_handler = $add_handler;
$view->page_name = $page_name;
# get the custom javascript;
#$view->global_readyJS(self::javascripts($review));
return $this->wrap_tool($view, 'review', $review);
}
示例3: _index
public function _index($calendar, $sub_tool = FALSE)
{
# $date format = year-month-day
list($page_name, $action, $date) = Uri::url_array();
$page_name = $this->get_page_name($page_name, 'calendar', $calendar->id);
$action = empty($action) ? 'nonsense' : $action;
if ('tool' == $action) {
$date = null;
}
$primary = new View('public_calendar/small/index');
switch ($action) {
case 'day':
$primary->events = $this->day($calendar->id, $date);
break;
}
$primary->calendar = $this->month($page_name, $calendar->id, $date);
# get the custom javascript;
$primary->global_readyJS(self::javascripts());
return $this->wrap_tool($primary, 'calendar', $calendar);
}
示例4: _index
public function _index($blog)
{
#echo kohana::debug($blog);die();
date_default_timezone_set('America/Los_Angeles');
# just for now
list($page_name, $action, $value, $value2) = Uri::url_array();
$page_name = $this->get_page_name($page_name, 'blog', $blog->id);
$action = (empty($action) or 'tool' == $action) ? 'homepage' : $action;
$view = new View("public_blog/blogs/index");
$view->tool_id = $blog->id;
$view->set_global('blog_page_name', $page_name);
$view->tags = $this->get_tags($blog->id);
$view->sticky_posts = $this->get_sticky_posts($blog->sticky_posts);
$view->recent_comments = $this->get_recent_comments($blog->id);
switch ($action) {
case 'entry':
$content = self::single_post($page_name, $value);
break;
case 'tag':
$content = self::tag_search($blog->id, $value);
break;
case 'archive':
$content = self::show_archive($blog->id, $value, $value2);
break;
case 'homepage':
# blog homepage
$blog_posts = $this->db->query("\n SELECT blog_posts.*, \n DATE_FORMAT(created, '%M %e, %Y, %l:%i%p') as created_on,\n GROUP_CONCAT(DISTINCT blog_post_tags.value ORDER BY blog_post_tags.value separator ',') as tag_string,\n COUNT(DISTINCT blog_post_comments.id) as comments\n FROM blog_posts\n LEFT JOIN blog_post_tags ON blog_posts.id = blog_post_tags.blog_post_id\n LEFT JOIN blog_post_comments ON blog_posts.id = blog_post_comments.blog_post_id\n WHERE blog_posts.blog_id = '{$blog->id}'\n AND blog_posts.fk_site = '{$this->site_id}' \n AND blog_posts.status = 'publish'\n GROUP BY blog_posts.id \n ORDER BY created DESC\n ");
$content = new View('public_blog/blogs/multiple_posts');
$content->blog_posts = $blog_posts;
break;
default:
Event::run('system.404');
break;
}
$view->content = $content;
# get the custom javascript;
$view->global_readyJS(self::javascripts());
return $this->wrap_tool($view, 'blog', $blog);
}
示例5: _index
public function _index($forum)
{
$url_array = Uri::url_array();
$page_name = $this->get_page_name($url_array['0'], 'forum', $forum->id);
$data = $url_array['2'];
$data2 = $url_array['3'];
$action = (empty($url_array['1']) or 'tool' == $url_array['1']) ? 'index' : $url_array['1'];
$wrapper = new View('public_forum/forums/index');
switch ($action) {
case 'index':
$wrapper->content = self::posts_wrapper($page_name, $forum->id, 'all');
break;
case 'category':
$wrapper->content = self::posts_wrapper($page_name, $forum->id, $data);
break;
case 'view':
$wrapper->content = self::comments_wrapper($page_name, $forum->id, $data, $data2);
break;
case 'vote':
$wrapper->content = self::vote($page_name, $forum->id, $data, $data2);
break;
case 'submit':
$wrapper->content = self::submit($page_name, $forum->id);
break;
case 'edit':
$wrapper->content = self::edit($page_name, $forum->id, $data, $data2);
break;
case 'my':
$wrapper->content = self::my($page_name, $forum->id, $data, $data2);
break;
default:
die("{$page_name} : {$action} : trigger 404 not found");
}
$wrapper->page_name = $page_name;
$wrapper->categories = self::categories($forum->id);
# get the custom javascript;
$wrapper->global_readyJS(self::javascripts());
return $this->wrap_tool($wrapper, 'forum', $forum);
}