Exemple #1
0
 public function getResponse()
 {
     $doc = new DOMDocument();
     $doc->loadXML('<nodeid>' . $this->context->queryToValue('//id') . '</nodeid>');
     $uiComposer = new \BaseXMS\UiComposer\UiComposer();
     $uiComposer->setServiceLocator($this->getServiceLocator());
     $uiComposer->setContextData($doc);
     $response = new ZendResponse();
     $response->setContent($uiComposer->run()->output());
     $response->setStatusCode(200);
     return $response;
 }
Exemple #2
0
 public function addDebugOutput($response)
 {
     // build doc for debug output
     $doctype = \DOMImplementation::createDocumentType('html');
     $doc = \DOMImplementation::createDocument(null, 'include', $doctype);
     $doc->lastChild->setAttribute('type', 'debug');
     // run it through the composer
     $uiComposer = new \BaseXMS\UiComposer\UiComposer();
     $uiComposer->setServiceLocator($this->serviceManager);
     $uiComposer->setDoc($doc);
     //TODO: allow to specify the output location for the debug output
     $content = $response->getContent() . $uiComposer->run()->output();
     $response->setContent($content);
     return $this;
 }