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


PHP AppController::view方法代码示例

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


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

示例1: view

 public function view($id = null)
 {
     if (is_int($id)) {
         parent::view($id);
     }
     $this->data->set('pageTitle', strip_tags($this->BlogPost->headline));
     $this->AppMetaTags->keywords->fromArray($this->SEOKeywords->extract($this->BlogPost->get('text')));
     // save comments
     if ($this->CommentForm->ok() && $this->request->get('md5') == $this->CommentForm->md5Secret) {
         $this->CommentForm->toModel($this->Comment);
         if ($this->Comment->hasField('ip')) {
             $this->Comment->set('ip', ip2long($this->request->host));
         }
         $this->Comment->foreign_id = $this->BlogPost->id;
         $this->Comment->set('model', 'BlogPost');
         if ($this->UserLogin->loggedin()) {
             $this->Comment->User = $this->UserLogin->User;
         }
         if (!$this->Comment->save()) {
             $this->CommentForm->errors = $this->Comment->validationErrors;
         } else {
             // send comment notification to all admins
             $this->ViewMailer->send(Registry::get('AdminEmail'), 'commentAdminNotification', __('Neuer Kommentar'), array('Comment' => $this->Comment));
             if (isset($this->ActionCache)) {
                 $this->ActionCache->clear($this->name, $this->action);
                 $this->ActionCache->clear($this->name, 'index');
             }
             $this->redirect($this->BlogPost->detailPageUri() . '#Comments');
         }
     }
     return true;
 }
开发者ID:Ephigenia,项目名称:harrison,代码行数:32,代码来源:BlogPostController.php

示例2: view

 public function view($id = null)
 {
     if ($id === 1) {
         $this->set('title_for_layout', 'Home');
     }
     $this->conditions = $this->Acl->conditions(array('contain' => array('DashboardSlot' => array('Widget'))));
     parent::view($id);
 }
开发者ID:Galvanio,项目名称:Kinspir,代码行数:8,代码来源:dashboards_controller.php

示例3: view

 public function view($id = null)
 {
     if (!$id) {
         $this->Redirect->flash('no_id', array('action' => 'index'));
     }
     // load the level
     $this->Event->id = $id;
     if ($stackId = $this->Event->field('stack_id')) {
         $this->_setLevel('stack', $stackId);
     } elseif ($milestoneId = $this->Event->field('milestone_id')) {
         $this->_setLevel('milestone', $milestoneId);
     } elseif ($workspaceId = $this->Event->field('workspace_id')) {
         $this->_setLevel('stack', $workspaceId);
     }
     parent::view($id);
 }
开发者ID:Galvanio,项目名称:Kinspir,代码行数:16,代码来源:events_controller.php

示例4: view

 public function view($id = null, $download = null)
 {
     if (!$id) {
         $this->Redirect->flash('no_id', array('action' => 'index'));
     }
     if ($download === 'download') {
         $this->__download($id);
     } else {
         $this->conditions = array('contain' => array('ActiveVersion' => array('User' => array('fields' => array('id', 'name'))), 'User', 'UploadVersion' => array('User' => array('fields' => array('id', 'name')))));
     }
     parent::view($id);
     // load the level
     if ($stackId = $this->Upload->field('stack_id')) {
         $this->_setLevel('stack', $stackId);
     } elseif ($milestoneId = $this->Upload->field('milestone_id')) {
         $this->_setLevel('milestone', $milestoneId);
     } elseif ($workspaceId = $this->Upload->field('workspace_id')) {
         $this->_setLevel('stack', $workspaceId);
     }
 }
开发者ID:Galvanio,项目名称:Kinspir,代码行数:20,代码来源:uploads_controller.php

示例5: view

 public function view($id = null)
 {
     if (!$id) {
         $this->Redirect->flash('no_id', array('action' => 'index'));
     }
     $this->conditions = array('contain' => array('AssignedTo', 'TaskGroup', 'Comment' => array('User' => array('fields' => array('id', 'name')), 'order' => array('id' => 'ASC'))));
     // load the level
     if ($stackId = $this->Task->field('stack_id')) {
         $this->_setLevel('stack', $stackId);
     } elseif ($milestoneId = $this->Task->field('milestone_id')) {
         $this->_setLevel('milestone', $milestoneId);
     } elseif ($workspaceId = $this->Task->field('workspace_id')) {
         $this->_setLevel('stack', $workspaceId);
     }
     parent::view($id);
 }
开发者ID:Galvanio,项目名称:Kinspir,代码行数:16,代码来源:tasks_controller.php

示例6: view

 function view($id = null)
 {
     $this->pageTitle = 'My Account';
     $user = $this->get_CurrentUser();
     $conditions = 'Order.member_id = ' . $user['Member']['id'];
     $fields = 'Order.id,Order.created,Order.total';
     $recursive = 0;
     if ($this->Roles->authorize(array(RolesComponent::SUPPLIER), false)) {
         $conditions = 'Order.id IN (SELECT i.order_id FROM orders_items i WHERE i.supplier_id = ' . $user['Supplier']['id'] . ')';
         $this->pageTitle = __('ACTIVITY_BRAND', true) . ' ' . __('SUPPLIER_BRANDS', true);
     }
     if (!empty($id)) {
         $conditions .= ' AND Order.id = ' . $id;
         $fields .= ',Order.cc_trans_id,Order.cc_type,Order.cc_name,Order.cc_expire,Order.add_1,Order.add_2,Order.add_city,Order.add_state,Order.add_zip,Order.add_country';
         $recursive = 1;
         $conditions_items = null;
         // Limit supplier detail view to their Activities
         if ($this->Roles->authorize(array(RolesComponent::SUPPLIER), false)) {
             $conditions_items = 'Items.supplier_id = ' . $user['Supplier']['id'];
         }
         $this->Order->hasMany['Items']['conditions'] = $conditions_items;
     }
     // Get order data
     $orders = $this->Order->find('all', array('conditions' => $conditions, 'fields' => $fields, 'order' => 'Order.created DESC', 'recursive' => $recursive));
     $this->set('orders', $orders);
     // Get all member data for the view
     parent::view($this->Member, $user['Member']['id']);
 }
开发者ID:natemow,项目名称:samples,代码行数:28,代码来源:orders_controller.php

示例7: viewActivity

 function viewActivity(&$id = null)
 {
     parent::view($this->Activity, $id);
     // Walk result and determine if Transactions are allowed
     $a = array($this->data);
     array_walk($a, array('AppController', 'set_RuntimeActivityParams'));
     $this->data = $a[0];
     if (!empty($this->params['named']['dt'])) {
         $this->data['Activity']['dt_selected'] = $this->params['named']['dt'];
     }
     return $this->data;
 }
开发者ID:natemow,项目名称:samples,代码行数:12,代码来源:activity_controller.php

示例8: control

 /**
  * undocumented 
  *
  * @author Joshua Davey
  * @param array $request
  */
 public static function control($request)
 {
     // because we allow controllers to be grouped into sub folders we need to recognize this when
     // someone tries to access them. For example if someone wants to access the 'admin/index' controller
     // they should be able to just type in 'admin' because 'index' is the default controller in that
     // group of controllers. To make this possible we check to see if a directory exists that is named
     // the same as the controller being called and then append the default controller name to the end
     // so 'admin' becomes 'admin/index' if the admin directory exists.
     // note: there is a consequence for this feature which means if you have a directory named 'admin'
     // you can't have a controller named 'Controller_Admin'
     if (is_dir('application/controllers/' . ucfirst($request['_controller']))) {
         $request['_controller'] .= '/' . 'index';
     }
     // set controller's class
     $controllerClassNodes = explode('/', $request['_controller']);
     foreach ($controllerClassNodes as &$node) {
         $node = Inflector::camelize($node);
     }
     $controllerClassNodes[count($controllerClassNodes) - 1] = ucfirst($controllerClassNodes[count($controllerClassNodes) - 1]);
     // set controller class
     $controllerClass = implode('\\', $controllerClassNodes) . 'Controller';
     try {
         $controller = new $controllerClass();
     } catch (Exception\AutoloadFail $e) {
         if (is_dir(self::$pathToProject . 'application/views/' . $request['_controller'])) {
             $view = $request['_controller'] . '/' . $request['_action'];
             $request['_controller'] = 'app';
             $controller = new \AppController();
             $controller->view($view);
         } elseif (is_file(self::$pathToProject . 'application/views/' . $request['_controller'] . '/' . $request['_action'] . '.' . $request['_format'])) {
             $view = $request['_controller'];
             $request['_action'] = $request['_controller'];
             $request['_controller'] = 'app';
             $controller = new \AppController();
             $controller->view($view);
         } else {
             // no controller or view found = critical error.
             //header("HTTP/1.1 404 Not Found");
             Exception::handle($e, array('message' => 'Missing Controller <strong>' . $controllerClass . "</strong> \n Create File: <strong>application/controllers/" . str_replace('_', DS, $controllerClass) . ".php</strong> \n <code>&lt;?php \n class {$controllerClass} extends AppController {\n\n  &nbsp; public function " . Inflector::camelize(lcfirst($request['_action'])) . "Action() {\n &nbsp;&nbsp;&nbsp; \n &nbsp; }\n\n   }</code>"));
             return;
         }
     }
     try {
         // process request
         $response = $controller->process($request);
         // delete controller
         unset($controller);
         // return response
         return $response;
     } catch (controller\exception\MissingAction $e) {
         //header("HTTP/1.1 404 Not Found");
         Exception::handle($e);
         return;
     } catch (controller\exception\MissingView $e) {
         header("HTTP/1.1 404 Not Found");
         Exception::handle($e);
         return;
     }
 }
开发者ID:joshdavey,项目名称:madeam,代码行数:65,代码来源:Framework.php

示例9: view

 public function view($id = null)
 {
     $this->setRelated();
     parent::view($id);
 }
开发者ID:abhinand4858,项目名称:ProgrammedV,代码行数:5,代码来源:ServicesController.php

示例10: view

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


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