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


PHP Controller::index方法代码示例

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


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

示例1: _callControllerMethod

 /**
  * If a method is passed in the GET url parameter
  *
  *  http://localhost/controller/method/(param)/(param)/(param)
  *  url[0] = Controller
  *  url[1] = Method
  *  url[2] = Param
  *  url[3] = Param
  *  url[4] = Param
  */
 private function _callControllerMethod()
 {
     $length = count($this->_url);
     // Make sure the method we are calling exists
     if ($length > 1) {
         if (!method_exists($this->_controller, $this->_url[1])) {
             $this->_controller->index();
             return false;
         }
     }
     // Determine what to load
     switch ($length) {
         case 5:
             //Controller->Method(Param1, Param2, Param3)
             $this->_controller->{$this->_url[1]}($this->_url[2], $this->_url[3], $this->_url[4]);
             break;
         case 4:
             //Controller->Method(Param1, Param2)
             $this->_controller->{$this->_url[1]}($this->_url[2], $this->_url[3]);
             break;
         case 3:
             //Controller->Method(Param1)
             $this->_controller->{$this->_url[1]}($this->_url[2]);
             break;
         case 2:
             //Controller->Method()
             $this->_controller->{$this->_url[1]}();
             break;
         default:
             $this->_controller->index();
             break;
     }
     return true;
 }
开发者ID:VanierRobotics,项目名称:2016,代码行数:44,代码来源:Bootstrap.php

示例2: _new

 public function _new()
 {
     parent::_new();
     $resource = $this->_uses[$this->modeltype];
     $db = DB::Instance();
     if ($resource->isLoaded()) {
         $this->_data['work_schedule_id'] = $resource->work_schedule_id;
         $this->view->set('workschedule', $resource->work_schedule_detail);
     } elseif (isset($this->_data['work_schedule_id'])) {
         $resource->work_schedule_id = $this->_data['work_schedule_id'];
         $this->view->set('workschedule', $resource->work_schedule_detail);
     } else {
         $workschedule = DataObjectFactory::Factory('WorkSchedule');
         $cc = new ConstraintChain();
         $cc->add(new Constraint('status', '!=', $workschedule->completedStatus()));
         $cc->add(new Constraint('status', '!=', $workschedule->cancelledStatus()));
         $this->view->set('workschedules', $workschedule->getAll($cc));
     }
     $person = DataObjectFactory::Factory('Person');
     $cc = new ConstraintChain();
     $cc->add(new Constraint('company_id', '=', COMPANY_ID));
     $this->view->set('people', $person->getAll($cc));
     $resources = new EngineeringResourceCollection($this->_templateobject);
     $sh = $this->setSearchHandler($resources);
     $sh->addConstraint(new Constraint('work_schedule_id', '=', $resource->work_schedule_id));
     parent::index($resources, $sh);
     $this->view->set('clickaction', 'edit');
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:28,代码来源:EngineeringresourcesController.php

示例3: view

 public function view()
 {
     $flash = Flash::Instance();
     // Preserve any search criteria selection so that the context is maintained
     $s_data = array();
     if (isset($this->_data['id'])) {
         $s_data['wh_transfer_id'] = $this->_data['id'];
     }
     $whtransfer = new WHTransfer();
     $whtransfer->load($this->_data['id']);
     $this->view->set('whtransfer', $whtransfer);
     $from_store = WHLocation::getStoreLocation($whtransfer->from_whlocation_id);
     $this->view->set('from_store', $from_store);
     $to_store = WHLocation::getStoreLocation($whtransfer->to_whlocation_id);
     $this->view->set('to_store', $to_store);
     $this->setSearch('whtransfersSearch', 'useDefault', $s_data);
     parent::index(new WHTransferlineCollection($this->_templateobject));
     $sidebar = new SidebarController($this->view);
     $sidebarlist = array();
     $sidebarlist['awaiting'] = array('link' => array_merge($this->_modules, array('controller' => 'WHTransfers', 'action' => 'selectWHTransfers')), 'tag' => 'View Transfers Awaiting Despatch');
     $sidebarlist['completed'] = array('link' => array_merge($this->_modules, array('controller' => 'WHTransfers', 'action' => 'viewWHTransfers')), 'tag' => 'View Completed Transfers');
     if ($whtransfer->awaitingTransfer()) {
         $sidebarlist['edit'] = array('link' => array_merge($this->_modules, array('controller' => 'WHTransfers', 'action' => 'transferStock', 'id' => $whtransfer->id)), 'tag' => 'Action this Transfer');
     }
     if ($whtransfer->transferred()) {
         $sidebarlist['edit'] = array('link' => array_merge($this->_modules, array('controller' => 'WHTransfers', 'action' => 'printaction', 'printaction' => 'printTransferNote', 'filename' => 'WHT' . $whtransfer->transfer_number, 'id' => $whtransfer->id)), 'tag' => 'Reprint Transfer Note');
     }
     $sidebar->addList('Actions', $sidebarlist);
     $this->view->register('sidebar', $sidebar);
     $this->view->set('sidebar', $sidebar);
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:31,代码来源:WhtransferlinesController.php

示例4: index

 public function index()
 {
     $flash = Flash::Instance();
     // Preserve any search criteria selection so that the context is maintained
     $s_data = array();
     if (isset($this->_data['id'])) {
         $s_data['wh_transfer_id'] = $this->_data['id'];
     }
     $this->view->set('clickaction', 'view');
     $whtransfer = new WHTransfer();
     $whtransfer->load($this->_data['id']);
     $this->view->set('whtransfer', $whtransfer);
     $from_store = WHLocation::getStoreLocation($whtransfer->from_whlocation_id);
     $this->view->set('from_store', $from_store);
     $to_store = WHLocation::getStoreLocation($whtransfer->to_whlocation_id);
     $this->view->set('to_store', $to_store);
     $this->setSearch('whtransfersSearch', 'useDefault', $s_data);
     parent::index(new WHTransferlineCollection($this->_templateobject));
     $sidebar = new SidebarController($this->view);
     $sidebarlist = array();
     $sidebarlist['all'] = array('tag' => 'View All Transfers', 'link' => array_merge($this->_modules, array('controller' => 'WHTransfers', 'action' => 'index')));
     if ($whtransfer->awaitingTransfer()) {
         $sidebarlist['edit'] = array('tag' => 'Edit this Transfer', 'link' => array_merge($this->_modules, array('controller' => 'WHTransfers', 'action' => 'edit', 'id' => $whtransfer->id)));
         $sidebarlist['cancel'] = array('tag' => 'Cancel this Transfer', 'link' => array_merge($this->_modules, array('controller' => 'WHTransfers', 'action' => 'cancel', 'id' => $whtransfer->id)));
     }
     $sidebar->addList('Actions', $sidebarlist);
     $this->view->register('sidebar', $sidebar);
     $this->view->set('sidebar', $sidebar);
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:29,代码来源:WhtransferlinesController.php

示例5: view

 public function view()
 {
     if (!$this->loadData()) {
         $this->dataError();
         sendBack();
     }
     $accesslist = $this->_uses[$this->modeltype];
     //		$this->addSidebar($systempolicy);
     $policy_permissions = new SystemPolicyControlListCollection();
     $sh = $this->setSearchHandler($policy_permissions);
     $sh->addConstraint(new Constraint('access_lists_id', '=', $accesslist->{$accesslist->idField}));
     parent::index($policy_permissions, $sh);
     $this->view->set('no_ordering', true);
     $sidebar = new SidebarController($this->view);
     $sidebarlist = array();
     $sidebarlist['alllists'] = array('link' => array('modules' => $this->_modules, 'controller' => $this->name, 'action' => 'index'), 'tag' => 'View All System Access Lists');
     $sidebar->addList('Actions', $sidebarlist);
     $sidebarlist = array();
     $sidebarlist['edit'] = array('link' => array('modules' => $this->_modules, 'controller' => $this->name, 'action' => 'edit', 'id' => $accesslist->{$accesslist->idField}), 'tag' => 'edit_access_list');
     $sidebarlist['delete'] = array('link' => array('modules' => $this->_modules, 'controller' => $this->name, 'action' => 'delete', 'id' => $accesslist->{$accesslist->idField}), 'tag' => 'delete_access_list');
     $sidebarlist['addpermission'] = array('link' => array('modules' => $this->_modules, 'controller' => 'systempolicycontrollists', 'action' => '_new', 'object_policies_id' => $accesslist->{$accesslist->idField}), 'tag' => 'add_policy_permission');
     $sidebar->addList('This Policy', $sidebarlist);
     $this->view->register('sidebar', $sidebar);
     $this->view->set('sidebar', $sidebar);
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:25,代码来源:SystempolicyaccesslistsController.php

示例6: index

 public function index()
 {
     $this->view->set('clickaction', 'view');
     $errors = array();
     $s_data = array();
     // Set context from calling module
     if (isset($this->_data['username'])) {
         $s_data['username'] = $this->_data['username'];
     }
     if (isset($this->_data['glcentre_id'])) {
         $s_data['glcentre_id'] = $this->_data['glcentre_id'];
     }
     $this->setSearch('poauthlimitsSearch', 'useDefault', $s_data);
     $username = $this->search->getValue('username');
     $glcentre_id = $this->search->getValue('glcentre_id');
     parent::index(new POAuthLimitCollection($this->_templateobject));
     $sidebar = new SidebarController($this->view);
     $actions = array();
     $actions['new'] = array('tag' => 'New Authorisation Limit', 'link' => array('modules' => $this->_modules, 'controller' => $this->name, 'action' => 'new'));
     if (isset($s_data['username']) && $s_data['username'] != '') {
         $actions['forperson'] = array('tag' => 'New Authorisation Limit for this person', 'link' => array('modules' => $this->_modules, 'controller' => $this->name, 'action' => 'new', 'username' => $username));
     }
     if (isset($s_data['glcentre_id']) && $s_data['glcentre_id'] != '0') {
         $actions['foraccount'] = array('tag' => 'New Authorisation Limit for this GL Centre', 'link' => array('modules' => $this->_modules, 'controller' => $this->name, 'action' => 'new', 'glcentre_id' => $s_data['glcentre_id']));
     }
     $sidebar->addList('Actions', $actions);
     $this->view->register('sidebar', $sidebar);
     $this->view->set('sidebar', $sidebar);
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:29,代码来源:PoauthlimitsController.php

示例7: index

 public function index()
 {
     parent::index($pi = new ProjectEquipmentAllocationCollection($this->_templateobject));
     $sidebar = new SidebarController($this->view);
     $sidebar->addList('Actions', array('new' => array('link' => array('module' => 'projects', 'controller' => 'ProjectEquipmentAllocations', 'action' => 'new'), 'tag' => 'new_Project Equipment Allocation')));
     $this->view->register('sidebar', $sidebar);
     $this->view->set('sidebar', $sidebar);
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:8,代码来源:ProjectequipmentallocationsController.php

示例8: index

 public function index()
 {
     $this->view->set('clickaction', 'edit');
     parent::index(new ComplaintCodeCollection($this->_templateobject));
     $sidebar = new SidebarController($this->view);
     $sidebar->addList('Actions', array('new' => array('link' => array('module' => $this->_modules['module'], 'controller' => $this->name, 'action' => 'new'), 'tag' => 'New Complaint Code'), 'view_scc' => array('link' => array('module' => $this->_modules['module'], 'controller' => 'Supplementarycomplaintcodes', 'action' => 'index'), 'tag' => 'View Supplementary Complaint Codes')));
     $this->view->register('sidebar', $sidebar);
     $this->view->set('sidebar', $sidebar);
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:9,代码来源:ComplaintcodesController.php

示例9: index

 public function index()
 {
     $this->view->set('clickaction', 'edit');
     parent::index(new SOPriceTypeCollection($this->_templateobject));
     $sidebar = new SidebarController($this->view);
     $sidebar->addList('Actions', array('new' => array('link' => array('modules' => $this->_modules, 'controller' => $this->name, 'action' => 'new'), 'tag' => 'new_Price_Type')));
     $this->view->register('sidebar', $sidebar);
     $this->view->set('sidebar', $sidebar);
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:9,代码来源:SopricetypesController.php

示例10: index

 public function index()
 {
     $this->view->set('clickaction', 'view');
     parent::index(new NewsletterCollection($this->_templateobject));
     $sidebar = new SidebarController($this->view);
     $sidebar->addList('Actions', array('new' => array('link' => array('module' => 'crm', 'controller' => 'Newsletters', 'action' => 'new'), 'tag' => 'new_Newsletter')));
     $this->view->register('sidebar', $sidebar);
     $this->view->set('sidebar', $sidebar);
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:9,代码来源:NewslettersController.php

示例11: index

 public function index()
 {
     $this->view->set('clickaction', 'edit');
     parent::index(new POrderLineCollection($this->_templateobject));
     $sidebar = new SidebarController($this->view);
     $sidebar->addList('Actions', array('new' => array('tag' => 'new_POrderLine', 'link' => array_merge($this->_modules, array('controller' => $this->name, 'action' => 'new')))));
     $this->view->register('sidebar', $sidebar);
     $this->view->set('sidebar', $sidebar);
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:9,代码来源:PorderlinesController.php

示例12: index

 public function index()
 {
     $this->view->set('clickaction', 'view');
     parent::index(new TicketAttachmentCollection($this->_templateobject));
     $sidebar = new SidebarController($this->view);
     $sidebar->addList('Actions', array('new' => array('link' => array('module' => 'ticketing', 'controller' => 'attachments', 'action' => 'new'), 'tag' => 'New Attachment')));
     $this->view->register('sidebar', $sidebar);
     $this->view->set('sidebar', $sidebar);
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:9,代码来源:AttachmentsController.php

示例13: index

 public function index()
 {
     $this->view->set('clickaction', 'view');
     parent::index(new SystemcompanyCollection($this->_templateobject));
     $sidebar = new SidebarController($this->view);
     $sidebar->addList('Actions', array('new' => array('link' => array('module' => 'system_admin', 'controller' => 'systemcompanys', 'action' => 'new'), 'tag' => 'new_system_company')));
     $this->view->register('sidebar', $sidebar);
     $this->view->set('sidebar', $sidebar);
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:9,代码来源:SystemcompanysController.php

示例14: index

 public function index()
 {
     global $smarty;
     $this->view->set('clickaction', 'edit');
     parent::index(new CalendarEventAttendeeCollection($this->_templateobject));
     $sidebar = new SidebarController($this->view);
     $sidebar->addList('Actions', array('new' => array('link' => array('module' => 'calendar', 'controller' => 'CalendarEventAttendees', 'action' => 'new'), 'tag' => 'new_Event_Attendee')));
     $this->view->register('sidebar', $sidebar);
     $this->view->set('sidebar', $sidebar);
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:10,代码来源:CalendareventattendeesController.php

示例15: index

 public function index()
 {
     parent::index(new ResourcetemplateCollection($this->_templateobject));
     $sidebar = new SidebarController($this->view);
     $sidebar->addList('Actions', array('new' => array('link' => array('module' => 'projects', 'controller' => 'resourcetemplate', 'action' => 'new'), 'tag' => 'new_resource_template')));
     $this->view->register('sidebar', $sidebar);
     $this->view->set('sidebar', $sidebar);
     $this->view->set('no_delete', false);
     $this->view->set('clickaction', 'view');
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:10,代码来源:ResourcetemplateController.php


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