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


PHP AppController::setStatus方法代码示例

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


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

示例1: array

 function admin_index()
 {
     /* Active/Inactive/Delete functionality */
     if (isset($this->request->data["SiteType"]["setStatus"])) {
         //pr($this->request->data);die;
         if (!empty($this->request->data['SiteType']['status'])) {
             $status = $this->request->data['SiteType']['status'];
         } else {
             $this->Session->setFlash("Please select the action.", 'default', array('class' => 'alert alert-danger'));
             $this->redirect(array('action' => 'admin_index'));
         }
         $CheckedList = $this->request->data['checkboxes'];
         $model = 'SiteType';
         $controller = $this->params['controller'];
         $action = $this->params['action'];
         parent::setStatus($status, $CheckedList, $model, $controller, $action);
     }
     /* Active/Inactive/Delete functionality */
     $value = "";
     $value1 = "";
     $show = "";
     $criteria = "";
     if (!empty($this->params)) {
         if (!empty($this->params->query['keyword'])) {
             $criteria .= " SiteType.name LIKE '%" . trim($this->params->query['keyword']) . "%' ";
         }
     }
     $this->Paginator->settings = array('conditions' => array($criteria), 'limit' => Configure::read('Settings.paginationLimit'), 'order' => array('SiteType.id' => 'DESC'));
     $this->set('getData', $this->Paginator->paginate('SiteType'));
     $this->set('keyword', $value);
     $this->set('show', $show);
     $this->set('navadmins', 'class = "active"');
     $this->set('breadcrumb', 'SiteTypes/Listing');
     $this->set('models', Inflector::singularize($this->name));
 }
开发者ID:praveensingh25000,项目名称:Bivid,代码行数:35,代码来源:SiteTypesController.php

示例2: array

 function admin_index()
 {
     //check for auth session
     $userSession = $this->Session->read('Auth.User');
     /* search functionality */
     $value = "";
     $value1 = "";
     $show = "";
     $conditions = array('Staff.admin_id !=' => 0);
     if (!empty($this->params)) {
         if (!empty($this->params->query['keyword'])) {
             $keyword = $this->params->query['keyword'];
             $value = $keyword;
             $conditions = array('OR' => array('Staff.firstname LIKE' => "%{$keyword}%", 'Staff.lastname LIKE' => "%{$keyword}%", 'Staff.username LIKE' => "%{$keyword}%", 'Staff.email LIKE' => "%{$keyword}%"), 'Staff.admin_id !=' => 0);
         }
     }
     //read pagination limit
     $limit = Configure::read('Settings.paginationLimit');
     //search and paginate
     $this->paginate = array('limit' => $limit, 'fields' => array(), 'conditions' => $conditions, 'order' => array('Staff.id' => 'desc'));
     $getData = $this->paginate('Staff');
     /* Active/Inactive/Delete functionality */
     if (isset($this->request->data["Staff"]["setStatus"])) {
         // echo 'here';die;
         if (!empty($this->request->data['Staff']['status'])) {
             $status = $this->request->data['Staff']['status'];
         } else {
             $this->Session->setFlash("Please select the action.", 'default', array('class' => 'alert alert-danger'));
             $this->redirect(array('action' => 'admin_index'));
         }
         if (!empty($this->request->data['checkboxes'])) {
             $CheckedList = $this->request->data['checkboxes'];
             $model = 'Staff';
             $controller = $this->params['controller'];
             $action = $this->params['action'];
             parent::setStatus($status, $CheckedList, $model, $controller, $action);
         }
     }
     //set layout
     $this->layout = $this->request->is('ajax') ? 'ajax' : 'admin';
     //set model
     $this->set('models', Inflector::singularize($this->name));
     //set breadcrumb
     $this->set('breadcrumb', 'Users/All list');
     //set pagination limit
     $this->set('limit', $limit);
     //set variables for search
     $this->set('keyword', $value);
     $this->set('show', $show);
     $this->set('navadmins', 'class = "active"');
     $this->set(compact('getData'));
     //pr($result);die;
 }
开发者ID:praveensingh25000,项目名称:Bivid,代码行数:53,代码来源:StaffsController.php


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