/**
  * Generate documentation for API
  * 
  * @return void
  */
 public function generate()
 {
     // Generate documentation
     $generator = new \Hubzero\Api\Doc\Generator();
     $documentation = $generator->output('array', true);
     // Output error messages
     foreach ($documentation['errors'] as $error) {
         $this->output->addLine($error, 'error');
     }
     // Successfully processed the following files
     foreach ($documentation['files'] as $file) {
         $this->output->addLine('Successfully processed the file: ' . $file, 'success');
     }
 }
Beispiel #2
0
 /**
  * Endpoint Documentation
  * 
  * @return  void
  */
 public function endpointTask()
 {
     // build pathway
     $this->_buildPathway();
     $active = Request::getVar('active', '');
     // generate documentation
     $generator = new \Hubzero\Api\Doc\Generator(!\Config::get('debug'));
     $documentation = $generator->output('array');
     if (!isset($documentation['sections'][$active])) {
         throw new \Exception(Lang::txt('Endpoint not found'), 404);
     }
     $this->view->active = $active;
     $this->view->documentation = $documentation;
     // render view
     $this->view->display();
 }