本文整理汇总了PHP中Model_Category::get_category_by_slug方法的典型用法代码示例。如果您正苦于以下问题:PHP Model_Category::get_category_by_slug方法的具体用法?PHP Model_Category::get_category_by_slug怎么用?PHP Model_Category::get_category_by_slug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Model_Category
的用法示例。
在下文中一共展示了Model_Category::get_category_by_slug方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_category
public function action_category()
{
$category_slug = $this->request->param('id');
if (empty($category_slug)) {
$this->request->redirect('products');
}
$view = View::factory('products/by_category');
$clients = new Model_Client();
$categories = new Model_Category();
$products = new Model_Product();
$user_session = Session::instance()->get('email');
$view->valute = $clients->get_user_valute($user_session);
$view->products = $products->get_products_by_category($category_slug);
$view->category = $categories->get_category_by_slug($category_slug);
$this->template->content = $view->render();
}