From a91b2a414eaed400e08441c7c6dcbf55b414202f Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Thu, 29 Dec 2011 11:24:10 -0500 Subject: [PATCH] Various formatting fixes --- sys/db.php | 19 +++++++++-------- sys/miniMVC.php | 57 +++++++++++++++++++++++-------------------------- sys/page.php | 10 ++++----- 3 files changed, 41 insertions(+), 45 deletions(-) diff --git a/sys/db.php b/sys/db.php index 08ae533..6da2bb5 100644 --- a/sys/db.php +++ b/sys/db.php @@ -8,15 +8,16 @@ class db extends PDO { private static $instance; public static function get_instance() - { - if ( ! isset(self::$instance)) { - echo 'Creating new instance of db class.'; - $className = __CLASS__; - self::$instance = new $className; - } - - return self::$instance; - } + { + if ( ! isset(self::$instance)) + { + echo 'Creating new instance of db class.'; + $className = __CLASS__; + self::$instance = new $className; + } + + return self::$instance; + } function __construct($dbname="default", $options=array()) { diff --git a/sys/miniMVC.php b/sys/miniMVC.php index cf43d6e..0350041 100644 --- a/sys/miniMVC.php +++ b/sys/miniMVC.php @@ -7,42 +7,39 @@ class miniMVC{ private static $instance; private static $count; - //var $output = new Output; - //var $page = new Page; - public static function get_instance() - { - if( ! isset(self::$count)) - { - self::$count = 0; - } - - if ( ! isset(self::$instance)) - { - self::$count++; - self::$instance = new miniMVC; - } - - $self =& self::$instance; - - return $self; - } - - /** - * Constructor - Any classes loaded here become subclasses of miniMVC - */ - public function __construct() - { - self::$instance =& $this; - } + { + if( ! isset(self::$count)) + { + self::$count = 0; + } + + if ( ! isset(self::$instance)) + { + self::$count++; + self::$instance = new miniMVC; + } + + $self =& self::$instance; + + return $self; + } + + /** + * Constructor - Any classes loaded here become subclasses of miniMVC + */ + public function __construct() + { + self::$instance =& $this; + } /** * Magic function called when cloning an object */ public function __clone() - { - trigger_error('Clone is not allowed.', E_USER_ERROR); - } + { + trigger_error('Clone is not allowed.', E_USER_ERROR); + } /** * PHP magic method to facilitate dynamic methods diff --git a/sys/page.php b/sys/page.php index 5f35f7e..2ec4701 100644 --- a/sys/page.php +++ b/sys/page.php @@ -41,8 +41,6 @@ class Page private function _headers($xhtml, $html5) { $this->mm->output->set_header("Cache-Control", "must-revalidate, public"); - - $this->mm->output->set_header("Vary", "Accept"); $mime = ""; //Variable for accept keyword @@ -100,9 +98,9 @@ class Page $doctype_string = ''; } - $doctype_string = "\n" + $doctype_string = "" . $doctype_string - . "\n"; + . ""; } else { @@ -321,7 +319,7 @@ class Page */ public function set_head_tag($tag) { - $this->head_tags .= $tag . "\n"; + $this->head_tags .= $tag; return $this; } @@ -470,7 +468,7 @@ class Page function render($view, $data=array()) { $this->build_header(); - $this->load_view($view, $data); + $this->mm->load_view($view, $data); $this->build_footer(); }