Mercurial > SimpleWebPresenter
diff Page.inc @ 94:2370f4450983
Document functions and move a few functions to more appropriate places.
| author | Tom Fredrik Blenning Klaussen <bfg@blenning.no> |
|---|---|
| date | Thu, 18 Oct 2012 17:33:34 +0200 |
| parents | 8aadd7a23b68 |
| children | d98e315308cd |
line wrap: on
line diff
--- a/Page.inc Thu Oct 18 16:44:48 2012 +0200 +++ b/Page.inc Thu Oct 18 17:33:34 2012 +0200 @@ -8,21 +8,43 @@ $cache->includeOnce('Options.inc', $baseDir); /// @endcond +/** + * Container for headers and content, used for compounding these + */ class PageContent { + /// The headers for the page public $headers = array(); + /// The content of the page public $content; + /** + * Constructs a PageContent object containing only content + * + * @param $content The content of this page + */ function __construct($content = "") { $this->content = $content; } + /** + * Sets a header + * + * @param $headername Name of the header + * @param $value Value for the header + */ function setHeader($headername, $value) { $this->headers[$headername] = $value; } + /** + * Returns a string representation of this object, containing only + * the content + * + * @return the content of the page + */ function __toString() { return $this->content; @@ -160,6 +182,11 @@ return $res; } + /** + * Displays the result from genPage. + * + * Printing headers and content. + */ function display() { $res = $this->genPage();
