本文整理汇总了PHP中Model_Category::find_by方法的典型用法代码示例。如果您正苦于以下问题:PHP Model_Category::find_by方法的具体用法?PHP Model_Category::find_by怎么用?PHP Model_Category::find_by使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Model_Category
的用法示例。
在下文中一共展示了Model_Category::find_by方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_index
/**
* The basic welcome message
*
* @access public
* @return Response
*/
public function action_index()
{
$this->setJavascript('responesive_tabs.js');
$this->setPageTitle('Funnycoder Top');
$aryDataTemplate = array();
$aryCategory = Model_Category::find_by(DELETE_FLG, '0');
$aryDataTemplate['category'] = $aryCategory;
$post = Input::param();
$where = array(array(DELETE_FLG, 0));
if (isset($post['category'])) {
$where[] = array(BLOG_CATEGORY_ID, $post['category']);
}
$configPagi = Config::get('pagi');
$configPagi['total_items'] = Model_Blog::count(array('where' => $where));
$pagination = Pagination::forge('mypagination', $configPagi);
$aryBlog = Model_Blog::find('all', array('where' => $where, 'order_by' => array(BLOG_CREATED_DATE => 'desc'), 'limit' => $pagination->per_page, 'offset' => $pagination->offset));
$aryDataTemplate['blog'] = $aryBlog;
$aryDataTemplate['pagi'] = $pagination;
$this->template->content = View_Smarty::forge('blog/index.tpl', $aryDataTemplate);
}