fixed some hidden bugs in our view components
This commit is contained in:
parent
9e44e1385b
commit
d0fe72e41e
6 changed files with 23 additions and 12 deletions
|
@ -21,7 +21,7 @@
|
|||
|
||||
namespace Volkszaehler\View\Csv;
|
||||
|
||||
class Csv extends \Volkszaehler\View\View {
|
||||
abstract class Csv extends \Volkszaehler\View\View {
|
||||
protected $csv = array();
|
||||
protected $header = array();
|
||||
protected $footer = array();
|
||||
|
@ -40,8 +40,6 @@ class Csv extends \Volkszaehler\View\View {
|
|||
}
|
||||
|
||||
public function render() {
|
||||
parent::render();
|
||||
|
||||
foreach ($this->header as $line) {
|
||||
echo $line . PHP_EOL;
|
||||
}
|
||||
|
@ -57,6 +55,8 @@ class Csv extends \Volkszaehler\View\View {
|
|||
foreach ($this->footer as $line) {
|
||||
echo $line . PHP_EOL;
|
||||
}
|
||||
|
||||
parent::render();
|
||||
}
|
||||
|
||||
public function addDebug() {
|
||||
|
|
|
@ -115,7 +115,7 @@ class JpGraph extends View {
|
|||
// Display the graph
|
||||
$this->graph->Stroke();
|
||||
|
||||
$this->response->send();
|
||||
parent::render();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace Volkszaehler\View\Json;
|
|||
|
||||
use Volkszaehler\Util;
|
||||
|
||||
class Json extends \Volkszaehler\View\View {
|
||||
abstract class Json extends \Volkszaehler\View\View {
|
||||
protected $json = array();
|
||||
|
||||
/*
|
||||
|
@ -39,9 +39,9 @@ class Json extends \Volkszaehler\View\View {
|
|||
}
|
||||
|
||||
public function render() {
|
||||
parent::render();
|
||||
|
||||
echo self::format(json_encode($this->json));
|
||||
|
||||
parent::render();
|
||||
}
|
||||
|
||||
protected static function format($json) {
|
||||
|
|
|
@ -58,4 +58,10 @@ class Channel extends Xml {
|
|||
|
||||
$this->xml->appendChild($xmlChannel);
|
||||
}
|
||||
|
||||
public function render() {
|
||||
$this->xmlRoot->appendChild($this->xml);
|
||||
|
||||
parent::render();
|
||||
}
|
||||
}
|
|
@ -22,6 +22,7 @@
|
|||
namespace Volkszaehler\View\Xml;
|
||||
|
||||
class Group extends Xml {
|
||||
protected $xml;
|
||||
|
||||
public function __construct(\Volkszaehler\View\Http\Request $request, \Volkszaehler\View\Http\Response $response) {
|
||||
parent::__construct($request, $response);
|
||||
|
@ -39,4 +40,10 @@ class Group extends Xml {
|
|||
|
||||
$this->xml->appendChild($xmlGroup);
|
||||
}
|
||||
|
||||
public function render() {
|
||||
$this->xmlRoot->appendChild($this->xml);
|
||||
|
||||
parent::render();
|
||||
}
|
||||
}
|
|
@ -22,9 +22,8 @@
|
|||
namespace Volkszaehler\View\Xml;
|
||||
|
||||
// TODO outdated
|
||||
class Xml extends \Volkszaehler\View\View {
|
||||
abstract class Xml extends \Volkszaehler\View\View {
|
||||
protected $xmlDoc;
|
||||
protected $xml;
|
||||
|
||||
public function __construct(\Volkszaehler\View\Http\Request $request, \Volkszaehler\View\Http\Response $response) {
|
||||
parent::__construct($request, $response);
|
||||
|
@ -40,11 +39,10 @@ class Xml extends \Volkszaehler\View\View {
|
|||
}
|
||||
|
||||
public function render() {
|
||||
parent::render();
|
||||
|
||||
$this->xmlDoc->appendChild($this->xmlRoot);
|
||||
$this->xmlRoot->appendChild($this->xml);
|
||||
echo $this->xmlDoc->saveXML();
|
||||
|
||||
parent::render();
|
||||
}
|
||||
|
||||
public function addException(\Exception $exception) {
|
||||
|
|
Loading…
Add table
Reference in a new issue