Advertisement
Guest User

Untitled

a guest
Mar 25th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.80 KB | None | 0 0
  1. <?php
  2. namespace BarradellJohns\Core;
  3. abstract class Page{
  4.     private $_title = null;
  5.     private $_stylesheets = array();
  6.     private $_javascript = array();
  7.     private $_body = null;
  8.     public function __construct(){
  9.     }
  10.     public function setTitle($title){
  11.         $this->_title = Database::getConnection()->real_escape_string($title);
  12.     }
  13.     public function addCSS($path){
  14.         $this->_stylesheets[] = $path;
  15.     }
  16.     public function addJavascript($path){
  17.         $this->_javascript[] = $path;
  18.     }
  19.     public function startBody(){
  20.         \ob_start();
  21.     }
  22.     public function endBody(){
  23.         $this->_body = \ob_get_clean();
  24.     }
  25.     public function render($pathToTemplate){
  26.         \ob_start();
  27.         include($pathToTemplate);
  28.         return \ob_get_clean();
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement