Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace BarradellJohns\Core;
- abstract class Page{
- private $_title = null;
- private $_stylesheets = array();
- private $_javascript = array();
- private $_body = null;
- public function __construct(){
- }
- public function setTitle($title){
- $this->_title = Database::getConnection()->real_escape_string($title);
- }
- public function addCSS($path){
- $this->_stylesheets[] = $path;
- }
- public function addJavascript($path){
- $this->_javascript[] = $path;
- }
- public function startBody(){
- \ob_start();
- }
- public function endBody(){
- $this->_body = \ob_get_clean();
- }
- public function render($pathToTemplate){
- \ob_start();
- include($pathToTemplate);
- return \ob_get_clean();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement