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


PHP AppController::index方法代码示例

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


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

示例1: index

 public function index()
 {
     $feedUsers = $this->_userConnections();
     $feedUsers[] = User::get('id');
     $Workspace = ClassRegistry::init('Workspace');
     $workspaces = $Workspace->find('all', $this->Acl->conditions(array('fields' => 'id'), array('cache' => false)));
     $workspaceIds = Set::extract('/Workspace/id', $workspaces);
     if (empty($workspaceIds)) {
         $workspaceIds = -1;
     }
     $conditions = array();
     switch (true) {
         case !empty($this->params['named']['view']):
             // keep conditions empty
             break;
         case $this->Session->check('Stack.id'):
             $conditions = array('conditions' => array('Feed.stack_id' => $this->Session->read('Stack.id')));
             break;
         case $this->Session->check('Milestone.id'):
             $conditions = array('conditions' => array('Feed.milestone_id' => $this->Session->read('Milestone.id')));
             break;
         case $this->Session->check('Workspace.id'):
             $conditions = array('conditions' => array('Feed.workspace_id' => $this->Session->read('Workspace.id')));
             break;
         default:
             $conditions = array('conditions' => array('OR' => array('Feed.user_id' => $feedUsers, 'Feed.workspace_id' => $workspaceIds)));
     }
     $conditions = Set::merge($conditions, array('order' => array('Feed.id DESC'), 'contain' => array('User' => array('fields' => array('id', 'name', 'email', 'facebook_id')), 'Milestone' => array('fields' => array('id', 'name')), 'Stack' => array('fields' => array('id', 'name')), 'Workspace' => array('fields' => array('id', 'name'))), 'limit' => 20));
     if (isset($this->params['named']['user'])) {
         $conditions['conditions'][] = array('User.id' => $this->params['named']['user']);
     }
     $this->paginate = $conditions;
     $this->set('title_for_layout', 'Feed');
     parent::index();
 }
开发者ID:Galvanio,项目名称:Kinspir,代码行数:35,代码来源:feeds_controller.php

示例2: index

 public function index()
 {
     $this->paginate = array('conditions' => array('Notification.receiver_id' => User::get('id')), 'contain' => array('NotificationType', 'User'), 'order' => array('Notification.id' => 'DESC'));
     parent::index();
     $this->Notification->updateAll(array('is_read' => 1), array('Notification.receiver_id' => User::get('id')));
     $this->Notification->User->id = User::get('id');
     $this->Notification->User->saveField('notification_count', 0);
 }
开发者ID:Galvanio,项目名称:Kinspir,代码行数:8,代码来源:notifications_controller.php

示例3: index

 function index()
 {
     parent::index();
     $q = $this->Ingredient->find('list', array('fields' => array('Ingre'), 'empty' => 'Selection d\'un ingrédient'));
     $this->set('ingredients', $q);
     $u = $this->Unity->find('list', array('fields' => array('nom_unite'), 'empty' => 'Selection d\'une unité'));
     $this->set('unitys', $u);
     $this->layout = 'default';
 }
开发者ID:erwanFab,项目名称:Recette,代码行数:9,代码来源:CreationsEntreesController.php

示例4: index

 public function index()
 {
     if (isset($this->params['page'])) {
         $this->data->appendTo('pageTitle', ' ' . __('Seite :1', (int) $this->params['page']));
     }
     if (in_array($this->layout, array('rss', 'ical', 'txt'))) {
         $this->BlogPost->unbind('Comment');
     }
     parent::index();
 }
开发者ID:Ephigenia,项目名称:harrison,代码行数:10,代码来源:BlogPostController.php

示例5: index

 public function index()
 {
     // if they are not in a workspace, let's refresh their cache
     // and merge the aclConditions in
     if ($this->Session->check('Workspace.id')) {
         $aclOptions = array('cache' => false, 'merge' => false);
     } else {
         $aclOptions = array('cache' => true, 'merge' => true);
     }
     // setup our conditions and filter them
     $this->paginate = $this->_filterLevel($this->Acl->conditions(array('contain' => array('User' => array('fields' => array('id', 'name')))), $aclOptions));
     parent::index(true);
 }
开发者ID:Galvanio,项目名称:Kinspir,代码行数:13,代码来源:uploads_controller.php

示例6: index

 public function index()
 {
     if ($this->RequestHandler->prefers('json')) {
         $conditions = array('fields' => array('id', 'name'), 'conditions' => array('id' => $this->_userConnections()));
         $results = $this->Connection->User->find('all', $conditions);
         $connections = array();
         foreach ($results as $result) {
             $result = $result['User'];
             $connections[] = array('value' => $result['id'], 'caption' => $result['name']);
         }
         $this->set(compact('connections'));
     } else {
         $this->paginate = array('conditions' => array('or' => array('User.id' => User::get('id'), 'Receiver.id' => User::get('id'))), 'order' => array('Connection.is_approved' => 'ASC', 'Connection.id' => 'DESC'), 'contain' => array('User' => array('fields' => array('id', 'name', 'email', 'facebook_id', 'username')), 'Receiver' => array('fields' => array('id', 'name', 'email', 'facebook_id', 'username'))));
         parent::index();
     }
 }
开发者ID:Galvanio,项目名称:Kinspir,代码行数:16,代码来源:connections_controller.php

示例7: index

 public function index()
 {
     // if they are not in a workspace, let's refresh their cache
     // and merge the aclConditions in
     if ($this->Session->check('Workspace.id')) {
         $aclOptions = array('cache' => false, 'merge' => false);
     } else {
         $aclOptions = array('cache' => true, 'merge' => true);
     }
     // setup our conditions
     $conditions = array('TaskGroup' => $this->Acl->conditions(array('order' => array('TaskGroup.order' => 'ASC'), 'limit' => null), $aclOptions));
     // if they pass a stack only show them task groups under that stack
     if (!empty($this->params['named']['stack'])) {
         $conditions['TaskGroup']['conditions'] = array('TaskGroup.stack_id' => $this->params['named']['stack']);
     }
     // filter our conditions
     $this->paginate = $this->_filterLevel($conditions, 'TaskGroup');
     parent::index();
 }
开发者ID:Galvanio,项目名称:Kinspir,代码行数:19,代码来源:task_groups_controller.php

示例8: index

 public function index()
 {
     // if they are not in a workspace, let's refresh their cache
     // and merge the aclConditions in
     if ($this->Session->check('Workspace.id')) {
         $aclOptions = array('cache' => false, 'merge' => false);
     } else {
         $aclOptions = array('cache' => true, 'merge' => true);
     }
     // the calendar is requesting milestones
     if ($this->RequestHandler->prefers('json')) {
         // setup our conditions
         $conditions = $this->Acl->conditions(array('fields' => array('id', 'name', 'starts', 'ends')), $aclOptions);
         // filter our conditions
         $conditions = $this->_filterLevel($conditions);
         $this->__calendarResponse($conditions);
         return;
     }
     // setup our conditions and filter them
     $this->paginate = $this->_filterLevel($this->Acl->conditions(null, $aclOptions));
     parent::index(true);
 }
开发者ID:Galvanio,项目名称:Kinspir,代码行数:22,代码来源:events_controller.php

示例9: index

 public function index()
 {
     // if they are not in a workspace, let's refresh their cache
     // and merge the aclConditions in
     if ($this->Session->check('Workspace.id')) {
         $aclOptions = array('cache' => false, 'merge' => false);
     } else {
         $aclOptions = array('cache' => true, 'merge' => true);
     }
     // the calendar is requesting tasks
     if ($this->RequestHandler->prefers('json')) {
         // setup our conditions
         $conditions = $this->Acl->conditions(array('fields' => array('id', 'name', 'due'), 'conditions' => array('NOT' => array('Task.due' => NULL), 'is_complete' => NULL)), $aclOptions);
         // filter our conditions
         $this->paginate = $this->_filterLevel($conditions);
         parent::index();
         return;
     }
     // the request is for a stack
     if (!empty($this->params['named']['stack'])) {
         // setup our conditions
         $conditions = $this->Acl->conditions(array('conditions' => array('Task.is_complete' => NULL, 'Task.stack_id' => $this->params['named']['stack'])), $aclOptions);
         // filter our conditions
         $this->paginate = $conditions;
         parent::index();
         return;
     }
     // setup our conditions
     $conditions = array('TaskGroup' => $this->Acl->conditions(array('contain' => array('Task' => array('conditions' => array('is_complete' => NULL), 'order' => array('Task.order' => 'ASC'), 'AssignedTo' => array('fields' => array('id', 'name')), 'Stack' => array('fields' => array('id', 'name')))), 'order' => array('TaskGroup.order' => 'ASC')), $aclOptions));
     // if they pass a task-group show them only that task group
     if (!empty($this->params['named']['task-group'])) {
         $conditions['TaskGroup']['conditions'] = array('TaskGroup.id' => $this->params['named']['task-group']);
     }
     // filter our conditions
     $this->paginate = $this->_filterLevel($conditions, 'TaskGroup');
     parent::index(array('controller' => 'task_groups', 'action' => 'add'), 'TaskGroup');
 }
开发者ID:Galvanio,项目名称:Kinspir,代码行数:37,代码来源:tasks_controller.php

示例10: index

 public function index()
 {
     $this->setRelated();
     parent::index();
 }
开发者ID:abhinand4858,项目名称:Project,代码行数:5,代码来源:ClientsController.php

示例11: index

 public function index()
 {
     // setup our conditions
     $this->paginate = $this->Acl->conditions();
     parent::index(array('controller' => 'workspaces', 'action' => 'add'), 'Workspace');
 }
开发者ID:Galvanio,项目名称:Kinspir,代码行数:6,代码来源:workspaces_controller.php

示例12: index

 public function index()
 {
     $this->paginate = array('conditions' => array('Dashboard.user_id' => User::get('id')), 'order' => array('Dashboard.order' => 'ASC'));
     parent::index();
 }
开发者ID:Galvanio,项目名称:Kinspir,代码行数:5,代码来源:dashboards_controller.php

示例13: check_logged_in

<?php

function check_logged_in()
{
    BaseController::check_logged_in();
}
$routes->get('/', function () {
    if ($user = AuthController::get_user_logged_in()) {
        AppController::index();
    } else {
        AuthController::index();
    }
});
$routes->post('/login', function () {
    // Kirjautumisen käsittely
    AuthController::handle_login();
});
$routes->get('/logout', function () {
    AuthController::signout();
});
$routes->get('/signup', function () {
    AuthController::signup();
});
$routes->post('/signup', function () {
    AuthController::handle_signup();
});
$routes->get('/tasks/create', 'check_logged_in', function () {
    AppController::createTask();
});
$routes->post('/tasks/create', 'check_logged_in', function () {
    AppController::storeTask();
开发者ID:sofiak,项目名称:Tsoha-Bootstrap,代码行数:31,代码来源:routes.php

示例14: index

 public function index()
 {
     parent::index();
 }
开发者ID:erwanFab,项目名称:Recette,代码行数:4,代码来源:CathegoriesController.php

示例15: index

 public function index()
 {
     AppController::index();
     $this->set('zeitzonenliste', timezone_identifiers_list());
 }
开发者ID:BackupTheBerlios,项目名称:chartersoftware-svn,代码行数:5,代码来源:flugplaetze_controller.php


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