/**
  * @param BaseController $value
  * @return string
  * @throws \Exception
  */
 public function output(BaseController $value)
 {
     $this->setVariable('CONTENT_TYPE', 'text/html');
     $this->setHeaders();
     $result = $value->getResult();
     if (gettype($result) == 'array') {
         $value->getTemplate()->addVariables($result);
     } else {
         $value->getTemplate()->addVariable('content', $result);
     }
     return $value->getTemplate()->render();
 }
 /**
  * @param BaseController $value
  * @return string
  */
 public function output(BaseController $value)
 {
     $this->setVariable('CONTENT_TYPE', 'application/json');
     $this->setHeaders();
     return json_encode($value->getResult());
 }