3 * This class simply puts HTML code / JavaScript code or CSS code out to the
6 class WebOutput extends BaseFrameworkSystem implements OutputStreamer {
8 * The instance for the singleton design pattern
10 private static $webInstance = null;
17 private function __construct () {
18 // Call parent constructor
19 parent::constructor(__CLASS__);
22 $this->setPartDescr("Web-Ausgabe-Handler");
24 // Create an unique ID
25 $this->createUniqueID();
29 * Create a new web output system and set the content type
31 * @param $contentType A valid content-type
32 * @return $debugInstance An instance of this middleware class
34 public final static function createWebOutput ($contentType) {
35 // Is there no instance?
36 if (is_null(self::$webInstance)) {
37 // Cast the content-type to string and trim it
38 $contentType = (string) $contentType;
39 $contentType = trim($contentType);
41 // Set the content type
42 if (!empty($contentType)) {
43 @header(sprintf("Content-type: %s",
48 // Get a new instance and set it
49 self::$webInstance = new WebOutput();
53 return self::$webInstance;
57 * Assigns a variable for output
59 * @param $var The variable we shall assign
60 * @param $value The value to store in the variable
63 public function assignVariable($var, $value) {
64 // Stub message because we don't have it here
65 trigger_error(__METHOD__.": Stub!");
73 public final function output ($outStream=false) {