Documentation is available at HtmlBody.php
- <?php
- /*
- * This file is part of Sylar.
- *
- * Sylar is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Sylar is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Sylar. If not, see <http://www.gnu.org/licenses/>.
- *
- * @copyright Copyright Sylar Development Team
- * @license http://www.gnu.org/licenses/ GNU Public License V2.0
- * @see https://launchpad.net/sylar/
- * @see http://www.giano-solutions.com
- */
- import('sylar.presentation.html.Html');
- import('sylar.presentation.html.HtmlDiv');
- /**
- * Html Body Element
- *
- * This object containes DIV object that will compose the Html page.
- * Css and Style will care about layout
- *
- * @package Sylar
- * @version 1.0
- * @since 31/mar/08
- * @author Gianluca Giusti [brdp] <g.giusti@giano-solutions.com>
- * @copyright Sylar Development Team
- */
- class Sylar_HtmlBody extends Sylar_Html{
- // An array of Sylar_HtmlDiv
- private $aDivArchive;
- function __construct(){
- // Inizialize the array
- $this->aDivArchive = array();
- }
- function __destruct(){
- // nothing to do at the moment
- }
- // Public Methods
- //__________________________________________________________________________
- /**
- * Add a Div to Body
- *
- * @see Sylar_HtmlDiv
- *
- * @return void
- * @param Sylar_HtmlDiv $oDiv the object with Div information and content
- */
- public function addDiv(Sylar_HtmlDiv $oDiv){
- if($oDiv != null){
- $this->aDivArchive[] = $oDiv;
- }
- }
- /**
- * return the Html source
- * it return html code of entire object
- *
- * @return string
- */
- public function getHtmlSource(){
- return $this->render();
- }
- /**
- * Display the page
- * it prints the object Html source on screen
- *
- * @return void
- */
- public function show(){
- echo $this->render();
- }
- // Protected Methods
- //__________________________________________________________________________
- /**
- * Design Html BODY tag
- * it push all div in the body and prepare html code
- *
- * @return string
- */
- protected function render(){
- $sTagHtml = "\n<body>\n";
- // Floating Style in the page <style> #classname: etc... </style>
- foreach ($this->aDivArchive as $val) {
- $sTagHtml .= "\n\t".$val->getHtmlSource();
- }
- $sTagHtml .= "\n\n</body>";
- return $sTagHtml;
- }
- }
- ?>
Documentation generated on Thu, 24 Apr 2008 16:14:14 +0200 by phpDocumentor 1.3.0RC3