Created
April 5, 2012 08:50
-
-
Save dustinlakin/2309287 to your computer and use it in GitHub Desktop.
Setting up Settings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//setup inside index.php | |
$config = new Settings(); | |
$config->scripts = array("jquery-1.7.1.min.js", "script.js"); | |
$config->styles = array("styles.css"); | |
//inside helpers/Settings.php class | |
public function __construct(){ | |
$this->siteRoot = str_replace("index.php", "", $_SERVER['PHP_SELF']); | |
$this->documentRoot = str_replace("index.php", "", $_SERVER['SCRIPT_FILENAME']); | |
$this->webRoot = $_SERVER['SERVER_NAME'] . $this->siteRoot; | |
$this->viewsPath = $this->documentRoot . "views/"; | |
$this->jsPath = $this->siteRoot . "js/"; | |
$this->cssPath = $this->siteRoot . "css/"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment