当前位置: 首页>>代码示例>>PHP>>正文


PHP SiteHelpers::arraySearch方法代码示例

本文整理汇总了PHP中SiteHelpers::arraySearch方法的典型用法代码示例。如果您正苦于以下问题:PHP SiteHelpers::arraySearch方法的具体用法?PHP SiteHelpers::arraySearch怎么用?PHP SiteHelpers::arraySearch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SiteHelpers的用法示例。


在下文中一共展示了SiteHelpers::arraySearch方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getIndex

 public function getIndex()
 {
     if ($this->access['is_view'] == 0) {
         return Redirect::to('')->with('message', SiteHelpers::alert('error', Lang::get('core.note_restric')));
     }
     // Filter sort and order for query
     $sort = !is_null(Input::get('sort')) ? Input::get('sort') : 'slideshow_id';
     $order = !is_null(Input::get('order')) ? Input::get('order') : 'asc';
     // End Filter sort and order for query
     // Filter Search for query
     $filter = !is_null(Input::get('search')) ? $this->buildSearch() : '';
     $filter .= " AND lang = '{$this->lang}'";
     // End Filter Search for query
     // Take param master detail if any
     $master = $this->buildMasterDetail();
     // append to current $filter
     $filter .= $master['masterFilter'];
     $page = Input::get('page', 1);
     $params = array('page' => $page, 'limit' => !is_null(Input::get('rows')) ? filter_var(Input::get('rows'), FILTER_VALIDATE_INT) : static::$per_page, 'sort' => $sort, 'order' => $order, 'params' => $filter, 'global' => isset($this->access['is_global']) ? $this->access['is_global'] : 0);
     // Get Query
     $results = $this->model->getRows($params);
     // Build pagination setting
     $page = $page >= 1 && filter_var($page, FILTER_VALIDATE_INT) !== false ? $page : 1;
     $pagination = Paginator::make($results['rows'], $results['total'], $params['limit']);
     $test = $this->model->columnTable();
     $arr_search = SiteHelpers::arraySearch(Input::get('search'));
     foreach ($arr_search as $key => $val) {
         if ($key != "sort" && $key != "order" && $key != "rows") {
             $test[$key]['value'] = $val;
         }
     }
     $this->data['test'] = $test;
     $this->data['rowData'] = $results['rows'];
     // Build Pagination
     $this->data['pagination'] = $pagination;
     // Build pager number and append current param GET
     $this->data['pager'] = $this->injectPaginate();
     // Row grid Number
     $this->data['i'] = $page * $params['limit'] - $params['limit'];
     // Grid Configuration
     $this->data['tableGrid'] = $this->info['config']['grid'];
     $this->data['tableForm'] = $this->info['config']['forms'];
     $this->data['colspan'] = SiteHelpers::viewColSpan($this->info['config']['grid']);
     // Group users permission
     $this->data['access'] = $this->access;
     // Detail from master if any
     $this->data['masterdetail'] = $this->masterDetailParam();
     $this->data['details'] = $master['masterView'];
     // Master detail link if any
     $this->data['subgrid'] = isset($this->info['config']['subgrid']) ? $this->info['config']['subgrid'] : array();
     // Render into template
     $this->layout->nest('content', 'Slideshow.index', $this->data)->with('menus', SiteHelpers::menus());
 }
开发者ID:blackorwhite1233,项目名称:fakekinhdoanh,代码行数:53,代码来源:SlideshowController.php

示例2: getIndex

 public function getIndex(Request $request)
 {
     if ($this->access['is_view'] == 0) {
         return Redirect::to('dashboard')->with('messagetext', \Lang::get('core.note_restric'))->with('msgstatus', 'error');
     }
     $sort = !is_null($request->input('sort')) ? $request->input('sort') : 'news_id';
     $order = !is_null($request->input('order')) ? $request->input('order') : 'asc';
     // End Filter sort and order for query
     // Filter Search for query
     $filter = !is_null($request->input('search')) ? $this->buildSearch() : '';
     $filter .= " AND lang = '{$this->lang}'";
     $page = $request->input('page', 1);
     $params = array('page' => $page, 'limit' => !is_null($request->input('rows')) ? filter_var($request->input('rows'), FILTER_VALIDATE_INT) : static::$per_page, 'sort' => $sort, 'order' => $order, 'params' => $filter, 'global' => isset($this->access['is_global']) ? $this->access['is_global'] : 0);
     // Get Query
     $results = $this->model->getRows($params);
     // Build pagination setting
     $page = $page >= 1 && filter_var($page, FILTER_VALIDATE_INT) !== false ? $page : 1;
     $pagination = new Paginator($results['rows'], $results['total'], $params['limit']);
     $pagination->setPath('news');
     $test = $this->model->columnTable();
     $arr_search = \SiteHelpers::arraySearch(Input::get('search'));
     foreach ($arr_search as $key => $val) {
         if ($key != "sort" && $key != "order" && $key != "rows") {
             $test[$key]['value'] = $val;
         }
     }
     $this->data['test'] = $test;
     $this->data['rowData'] = $results['rows'];
     // Build Pagination
     $this->data['pagination'] = $pagination;
     // Build pager number and append current param GET
     $this->data['pager'] = $this->injectPaginate();
     // Row grid Number
     $this->data['i'] = $page * $params['limit'] - $params['limit'];
     // Grid Configuration
     $this->data['tableGrid'] = $this->info['config']['grid'];
     $this->data['tableForm'] = $this->info['config']['forms'];
     $this->data['colspan'] = \SiteHelpers::viewColSpan($this->info['config']['grid']);
     // Group users permission
     $this->data['access'] = $this->access;
     // Detail from master if any
     // Master detail link if any
     $this->data['subgrid'] = isset($this->info['config']['subgrid']) ? $this->info['config']['subgrid'] : array();
     // Render into template
     return view('news.index', $this->data);
 }
开发者ID:blackorwhite123,项目名称:cms_laravel5,代码行数:46,代码来源:NewsController.php

示例3: getIndex

 public function getIndex()
 {
     if ($this->access['is_view'] == 0) {
         return Redirect::to('')->with('message', SiteHelpers::alert('error', Lang::get('core.note_restric')));
     }
     // Filter sort and order for query
     $sort = !is_null(Input::get('sort')) ? Input::get('sort') : 'id';
     $order = !is_null(Input::get('order')) ? Input::get('order') : 'asc';
     // End Filter sort and order for query
     // Filter Search for query
     $filter = !is_null(Input::get('search')) ? $this->buildSearch() : '';
     // End Filter Search for query
     $filter .= " AND id !='1' ";
     $page = Input::get('page', 1);
     $params = array('page' => $page, 'limit' => !is_null(Input::get('rows')) ? filter_var(Input::get('rows'), FILTER_VALIDATE_INT) : static::$per_page, 'sort' => $sort, 'order' => $order, 'params' => $filter);
     // Get Query
     $results = $this->model->getRows($params);
     $page = $page >= 1 && filter_var($page, FILTER_VALIDATE_INT) !== false ? $page : 1;
     $pagination = Paginator::make($results['rows'], $results['total'], $params['limit']);
     $test = $this->model->columnTable();
     $arr_search = SiteHelpers::arraySearch(Input::get('search'));
     foreach ($arr_search as $key => $val) {
         if ($key != "sort" && $key != "order" && $key != "rows") {
             $test[$key]['value'] = $val;
         }
     }
     $this->data['test'] = $test;
     $this->data['rowData'] = $results['rows'];
     $this->data['pagination'] = $pagination;
     $this->data['pager'] = $this->injectPaginate();
     $this->data['i'] = $page * $params['limit'] - $params['limit'];
     $this->data['tableGrid'] = $this->info['config']['grid'];
     $this->data['tableForm'] = $this->info['config']['forms'];
     $this->data['colspan'] = SiteHelpers::viewColSpan($this->info['config']['grid']);
     $this->data['access'] = $this->access;
     $this->layout->nest('content', 'users.index', $this->data)->with('menus', SiteHelpers::menus());
 }
开发者ID:blackorwhite1233,项目名称:fakekinhdoanh,代码行数:37,代码来源:UsersController.php


注:本文中的SiteHelpers::arraySearch方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。