本文整理汇总了PHP中Model_Location::find_all方法的典型用法代码示例。如果您正苦于以下问题:PHP Model_Location::find_all方法的具体用法?PHP Model_Location::find_all怎么用?PHP Model_Location::find_all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Model_Location
的用法示例。
在下文中一共展示了Model_Location::find_all方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_index
public function action_index()
{
$cat = new Model_Category();
$list_cat = $cat->find_all();
// get all to print at sidebar view
$loc = new Model_Location();
$list_loc = $loc->find_all();
// get all to print at sidebar view
$user = Auth::instance()->get_user();
$ads = new Model_Ad();
Controller::$full_width = TRUE;
$my_adverts = $ads->where('id_user', '=', $user->id_user);
$res_count = $my_adverts->count_all();
if ($res_count > 0) {
$pagination = Pagination::factory(array('view' => 'oc-panel/crud/pagination', 'total_items' => $res_count, 'items_per_page' => core::config('advertisement.advertisements_per_page')))->route_params(array('controller' => $this->request->controller(), 'action' => $this->request->action()));
Breadcrumbs::add(Breadcrumb::factory()->set_title(__('My ads'))->set_url(Route::url('oc-panel', array('controller' => 'myads', 'action' => 'index'))));
Breadcrumbs::add(Breadcrumb::factory()->set_title(sprintf(__("Page %d"), $pagination->current_page)));
$ads = $my_adverts->order_by('published', 'desc')->limit($pagination->items_per_page)->offset($pagination->offset)->find_all();
$this->template->content = View::factory('oc-panel/profile/ads', array('ads' => $ads, 'pagination' => $pagination, 'category' => $list_cat, 'location' => $list_loc, 'user' => $user));
} else {
$this->template->content = View::factory('oc-panel/profile/ads', array('ads' => $ads, 'pagination' => NULL, 'category' => NULL, 'location' => NULL, 'user' => $user));
}
}