Ejemplo n.º 1
1
 /**
  * Show/return documentation
  *
  * Returns a ContentNegotiation view model to allow for multiple
  * representations of documentation.
  *
  * @return ViewModel
  */
 public function showAction()
 {
     $apiName = $this->params()->fromRoute('api');
     $apiVersion = $this->params()->fromRoute('version', '1');
     $serviceName = $this->params()->fromRoute('service');
     $viewModel = new ViewModel();
     $viewModel->setTemplate('zf-apigility-documentation/show');
     $viewModel->setVariable('baseUrl', $this->serverUrlViewHelper->__invoke());
     if (!$apiName) {
         $apiList = $this->apiFactory->createApiList();
         $viewModel->setVariable('apis', $apiList);
         $viewModel->setVariable('type', 'apiList');
         return $viewModel;
     }
     $api = $this->apiFactory->createApi($apiName, $apiVersion);
     if (!$serviceName) {
         $viewModel->setVariable('documentation', $api);
         $viewModel->setVariable('type', 'api');
         return $viewModel;
     }
     $service = $this->apiFactory->createService($api, $serviceName);
     $viewModel->setVariable('documentation', $service);
     $viewModel->setVariable('type', 'service');
     return $viewModel;
 }
 /**
  * @return ViewModel
  */
 public function showAction()
 {
     $apiName = $this->params()->fromRoute('api');
     $apiVersion = $this->params()->fromRoute('version', '1');
     $viewModel = new ViewModel(['api' => $apiName]);
     $viewModel->setTemplate('zf-apigility-documentation-blueprint/api');
     $viewModel->setTerminal(true);
     $api = $this->apiFactory->createApi($apiName, $apiVersion);
     $viewModel->setVariable('documentation', $api);
     $viewModel->setVariable('type', 'api');
     return $viewModel;
 }
Ejemplo n.º 3
0
 /**
  * Receive code action prints the code/token access
  */
 public function receiveCodeAction()
 {
     $code = $this->params()->fromQuery('code', false);
     $view = new ViewModel(['code' => $code]);
     $view->setTemplate('oauth/receive-code');
     return $view;
 }
 /**
  * @param array $process
  * @return ViewModel
  */
 private function incompleteAction(array $process)
 {
     $view = new ViewModel(['process' => $process]);
     $view->setTemplate('prooph/link/monitor/process-view/process-details-incomplete');
     return $view;
 }