Initial Commit

This commit is contained in:
2012-06-11 12:08:59 -05:00
commit 138af6c355
8 changed files with 225 additions and 0 deletions

41
core/uri_library.php Normal file
View File

@@ -0,0 +1,41 @@
<?php
/* The URI Library is necessary for the framework
* to succesfully route
*/
class Uri_library {
private $uri_array = array();
public function __construct($uri=NULL) {
if(isset($uri)) {
$this->parseURI($uri);
}
}
public function parseURI($uri=NULL) {
if(substr($uri,0,10)=="/index.php") {
$uri = substr($uri,10);
}
$uri=substr($uri,1);
$this->uri_array = explode("/",$uri);
}
public function getFullArray() {
return $this->uri_array;
}
public function getItem($iid=0) {
if(isset($this->uri_array[$iid])) {
return $this->uri_array[$iid];
}
return false;
}
public function redirect($url=NULL) {
if(isset($url)) {
header('Location: '.$url);
}
}
}
?>