From 01d08ab01618f1a00251fc3d49cad723d6efbf4c Mon Sep 17 00:00:00 2001 From: Pavan Kumar Sunkara Date: Fri, 14 May 2010 16:25:48 +0530 Subject: [PATCH] Added HTML helper in boot and provided path to css,js,img files --- index.php | 23 ++++++++++++++++------- sun/boot.php | 22 ++++++++++++++-------- sun/view.php | 2 +- 3 files changed, 31 insertions(+), 16 deletions(-) diff --git a/index.php b/index.php index 4160ade..2b638eb 100644 --- a/index.php +++ b/index.php @@ -42,13 +42,22 @@ } /** - * Include boot.php which loads all the files + * No need to go to dispatch if it is css or js or img */ - require_once CORE.'boot.php'; - -/** - * Include index.php which does the main dispatching and outputing - */ - require_once WWW.'index.php'; + $url = explode("/",URL); + array_shift($url); + if($url[0] == "css" || $url[0] == "js" || $url[0] == "img") + require_once WWW.implode("/",$url); + else { + /** + * Include boot.php which loads all the files + */ + require_once CORE.'boot.php'; + + /** + * Include index.php which does the main dispatching and outputing + */ + require_once WWW.'index.php'; + } ?> diff --git a/sun/boot.php b/sun/boot.php index cbea76e..7ab0731 100644 --- a/sun/boot.php +++ b/sun/boot.php @@ -39,7 +39,7 @@ /** * Basic class for using cookie variables - * Usage: "Cookie::" + * Usage: "$Cookie->" */ if(Configure::read('lib.cookie')) { require_once CORE.'cookie.php'; @@ -79,7 +79,7 @@ /** * Basic class for sending emails in PHP - * Usage: "Email::" + * Usage: "$Email->" */ if(Configure::read('lib.email')) { require_once CORE.'email.php'; @@ -93,6 +93,12 @@ require_once CORE.'file.php'; } +/** + * Basic class for HTML helper + * Usage: "$HTML->" + */ + require_once CORE.'html.php'; + /** * Basic class for maintaining naming conventions * Usage: "Inflector::" @@ -109,7 +115,7 @@ /** * Basic class for Localisation of languages - * Usage: "l10n::" + * Usage: "$l10n->" */ require_once CORE.'l10n.php'; @@ -131,7 +137,7 @@ /** * Basic class for using RSS feed - * Usage: "RSS::" + * Usage: "$RSS->" */ if(Configure::read('lib.rss')) { require_once CORE.'rss.php'; @@ -145,19 +151,19 @@ /** * Basic class for sanitizing strings and conversion - * Usage: "Sanitize::" + * Usage: "$Sanitize->" */ require_once CORE.'sanitize.php'; /** * Basic class for security hashing and others - * Usage: "Security::" + * Usage: "$Security->" */ require_once CORE.'security.php'; /** * Basic class for using session variables - * Usage: "Session::" + * Usage: "$Session->" */ if(Configure::read('lib.session')) { require_once CORE.'session.php'; @@ -183,7 +189,7 @@ /** * Basic class for various validation techniques - * Usage: "Validation::" + * Usage: "$Validation->" */ require_once CORE.'validation.php'; diff --git a/sun/view.php b/sun/view.php index d0a2ec7..c81744d 100644 --- a/sun/view.php +++ b/sun/view.php @@ -33,7 +33,7 @@ function __construct() { */ function render($file,$data) { extract($data, EXTR_SKIP); - extract($help, EXTR_SKIP); + extract(self::$help, EXTR_SKIP); ob_start(); if (file_exists($file))