本文整理汇总了PHP中uri::url_array方法的典型用法代码示例。如果您正苦于以下问题:PHP uri::url_array方法的具体用法?PHP uri::url_array怎么用?PHP uri::url_array使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类uri
的用法示例。
在下文中一共展示了uri::url_array方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _index
public function _index($showroom, $sub_tool = FALSE)
{
$url_array = uri::url_array();
list($page_name, $first_node, $item) = $url_array;
$page_name = $this->get_page_name($page_name, 'showroom', $showroom->id);
# parse the params.
$params = explode('|', $showroom->params);
$primary = new View("public_showroom/display/wrapper");
# what is the url asking for?
if ('get' == $url_array['0'] or empty($first_node)) {
# if empty, display default category
$primary->items = empty($showroom->home_cat) ? '(Home Category not set)' : self::items_category($page_name, $showroom, (int) $showroom->home_cat);
} elseif (is_numeric($first_node)) {
if ('0' == substr($first_node, 0, 1)) {
$primary->item = self::item($page_name, $first_node, $item);
} else {
$primary->items = self::items_category($page_name, $showroom, $first_node);
}
} else {
Event::run('system.404');
}
# determine the category to highlight.
$first_node = empty($first_node) ? $showroom->home_cat : $first_node;
# how do we show the category list on every showroom page?
$category_list = '';
if (!empty($params[0])) {
if ('flat' == $params[0]) {
# showing only root categories.
$root_cats = ORM::factory('showroom_cat')->where(array('fk_site' => $this->site_id, 'showroom_id' => $showroom->id, 'local_parent' => $showroom->root_id))->orderby(array('lft' => 'asc'))->find_all();
$category_list = Tree::display_flat_tree('showroom', $root_cats, $page_name, $first_node);
} else {
$category_list = Tree::display_tree('showroom', $showroom->showroom_cats, $page_name, $first_node);
}
}
$primary->categories = $category_list;
# add custom javascript;
$primary->global_readyJS(self::javascripts($showroom));
# admin js hack.
if ($this->client->can_edit($this->site_id)) {
$primary->global_readyJS('
$("#click_hook").click(function(){
$().add_toolkit_items("showroom");
});
');
}
return $this->wrap_tool($primary, 'showroom', $showroom);
}