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


PHP BaseController::prepareForEdit方法代码示例

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


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

示例1: prepareForEdit

 /**
  * Override the edit action to supply some selectable relationships
  *
  * @param MappedObject $model
  */
 protected function prepareForEdit($model = null)
 {
     $clientid = $model && $model->clientid ? $model->clientid : (int) $this->_getParam('clientid');
     // check the existence of the client to add this contact to
     $client = $clientid ? $this->clientService->getClient($clientid) : null;
     // check the existence of the client to add this contact to
     $this->view->owners = $this->groupService->getGroups();
     $this->view->users = $this->userService->getUserList();
     $this->view->client = $client;
     $this->view->clients = $this->clientService->getClients();
     $this->view->projects = $clientid ? $this->projectService->getProjectsForClient($client) : array();
     parent::prepareForEdit($model);
 }
开发者ID:nyeholt,项目名称:relapse,代码行数:18,代码来源:ProjectController.php

示例2: prepareForEdit

 /**
  * Prepare a feature to be edited
  *
  * @param Feature $model
  * @return
  */
 public function prepareForEdit($model)
 {
     $project = $this->projectService->getProject((int) $this->_getParam('projectid', $model->projectid));
     $parentFeature = $this->projectService->getFeature((int) $this->_getParam('parent'));
     if ($project == null) {
         $this->flash("Specified project not found");
         $this->renderView('error.php');
         return;
     }
     $this->view->project = $project;
     if ($parentFeature) {
         $this->view->parentfeature = $parentFeature->id;
     }
     if ($model->id) {
         $this->view->linkedToFeatures = $this->itemLinkService->getLinkedItems($model, 'from', 'Feature');
         $this->view->linkedFromFeatures = $this->itemLinkService->getLinkedItems($model, 'to', 'Feature');
     } else {
         $model->milestone = $this->_getParam('milestone');
     }
     $this->view->projects = $this->projectService->getProjectsForClient($project->clientid);
     $this->view->projectFeatures = $this->featureService->getFeatures(array('projectid=' => $project->id));
     $this->view->projectTasks = $this->projectService->getTasks(array('projectid=' => $project->id), 'title asc');
     $this->view->priorities = array('Must Have', 'Should Have', 'Would Like', 'Nice To Have');
     $this->view->statuses = $model->constraints['status']->getValues();
     $this->view->linkedTasks = array();
     if ($model->id) {
         $this->view->linkedTasks = $this->itemLinkService->getLinkedItemsOfType($model, 'from', 'Task');
     }
     parent::prepareForEdit($model);
 }
开发者ID:nyeholt,项目名称:relapse,代码行数:36,代码来源:FeatureController.php


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