diff --git a/config/routes.conf.php b/config/routes.conf.php index e9a23cc..a01ec50 100644 --- a/config/routes.conf.php +++ b/config/routes.conf.php @@ -1,3 +1,3 @@ display(VIEWS . 'inc/header.tpl'); + $smarty->display(VIEWS . '404.tpl'); +} else { + $smarty->display(VIEWS . 'inc/header.tpl'); + $smarty->display(VIEWS . $action . '.tpl'); +} + + +$smarty->display(VIEWS . 'inc/footer.tpl'); + diff --git a/index.php b/index.php index 019d614..1a06e99 100644 --- a/index.php +++ b/index.php @@ -6,5 +6,10 @@ define('CONFIG', 'config/'); require_once(CONFIG . 'conf.php'); require_once(LIB . 'vendor/autoload.php'); +require_once (LIB . 'Router.php'); +$Router = new Router(); +$url = $Router->getUrl(); +$action = $Router->getAction(); +$smarty = new Smarty(); -$smarty = new Smarty(); \ No newline at end of file +require_once CONTROLLERS . $Router->getController() . '.php'; diff --git a/libraries/Router.php b/libraries/Router.php index 27a0889..fd4b45d 100644 --- a/libraries/Router.php +++ b/libraries/Router.php @@ -11,12 +11,12 @@ class Router public function __construct() { $routes = []; - require_once '../config/routes.conf.php'; + require_once CONFIG . 'routes.conf.php'; $this->routes = $routes; $url = explode('?', $_SERVER['REQUEST_URI']); $this->url = explode('/', $url[0]); $this->action = empty($this->url[BASE_URL_PART + 1]) ? 'home' : $this->url[BASE_URL_PART + 1]; - $this->id = empty($this->url[BASE_URL_PART + 2]) ? null : $this->url[BASE_URL_PART + 2]; + $this->page = empty($this->url[BASE_URL_PART + 2]) ? null : $this->url[BASE_URL_PART + 2]; $this->res(); } @@ -46,8 +46,8 @@ public function getAction() { return $this->action; } - public function getId() { - return $this->id; + public function getPage() { + return $this->page; } public function getUrl() { diff --git a/public/stylesheet/fonts/open-sans.less b/public/stylesheet/fonts/open-sans.less new file mode 100644 index 0000000..eaf05ac --- /dev/null +++ b/public/stylesheet/fonts/open-sans.less @@ -0,0 +1,154 @@ +/* Open Sans @font-face kit */ + +@OpenSansPath: "./open-sans"; + +/* BEGIN Light */ +@font-face { + font-family: 'Open Sans'; + src: url('@{OpenSansPath}/Light/OpenSans-Light.eot'); + src: url('@{OpenSansPath}/Light/OpenSans-Light.eot?#iefix') format('embedded-opentype'), + url('@{OpenSansPath}/Light/OpenSans-Light.woff') format('woff'), + url('@{OpenSansPath}/Light/OpenSans-Light.ttf') format('truetype'), + url('@{OpenSansPath}/Light/OpenSans-Light.svg#OpenSansLight') format('svg'); + font-weight: 300; + font-style: normal; +} + +.open-sans-light { + font-family: 'Open Sans', sans-serif; + font-weight: 300; +} + +/* END Light */ + +/* BEGIN Light Italic */ +@font-face { + font-family: 'Open Sans'; + src: url('@{OpenSansPath}/LightItalic/OpenSans-LightItalic.eot'); + src: url('@{OpenSansPath}/LightItalic/OpenSans-LightItalic.eot?#iefix') format('embedded-opentype'), + url('@{OpenSansPath}/LightItalic/OpenSans-LightItalic.woff') format('woff'), + url('@{OpenSansPath}/LightItalic/OpenSans-LightItalic.ttf') format('truetype'), + url('@{OpenSansPath}/LightItalic/OpenSans-LightItalic.svg#OpenSansLightItalic') format('svg'); + font-weight: 300; + font-style: italic; +} + +.open-sans-light { + font-family: 'Open Sans', sans-serif; + font-style: italic; + font-weight: 300; +} + +/* END Light Italic */ + +/* BEGIN Regular */ +@font-face { + font-family: 'Open Sans'; + src: url('@{OpenSansPath}/Regular/OpenSans-Regular.eot'); + src: url('@{OpenSansPath}/Regular/OpenSans-Regular.eot?#iefix') format('embedded-opentype'), + url('@{OpenSansPath}/Regular/OpenSans-Regular.woff') format('woff'), + url('@{OpenSansPath}/Regular/OpenSans-Regular.ttf') format('truetype'), + url('@{OpenSansPath}/Regular/OpenSans-Regular.svg#OpenSansRegular') format('svg'); + font-weight: normal; + font-style: normal; +} + +/* END Regular */ + +/* BEGIN Italic */ +@font-face { + font-family: 'Open Sans'; + src: url('@{OpenSansPath}/Italic/OpenSans-Italic.eot'); + src: url('@{OpenSansPath}/Italic/OpenSans-Italic.eot?#iefix') format('embedded-opentype'), + url('@{OpenSansPath}/Italic/OpenSans-Italic.woff') format('woff'), + url('@{OpenSansPath}/Italic/OpenSans-Italic.ttf') format('truetype'), + url('@{OpenSansPath}/Italic/OpenSans-Italic.svg#OpenSansItalic') format('svg'); + font-weight: normal; + font-style: italic; +} + +/* END Italic */ + +/* BEGIN Semibold */ +@font-face { + font-family: 'Open Sans'; + src: url('@{OpenSansPath}/Semibold/OpenSans-Semibold.eot'); + src: url('@{OpenSansPath}/Semibold/OpenSans-Semibold.eot?#iefix') format('embedded-opentype'), + url('@{OpenSansPath}/Semibold/OpenSans-Semibold.woff') format('woff'), + url('@{OpenSansPath}/Semibold/OpenSans-Semibold.ttf') format('truetype'), + url('@{OpenSansPath}/Semibold/OpenSans-Semibold.svg#OpenSansSemibold') format('svg'); + font-weight: 600; + font-style: normal; +} + +/* END Semibold */ + +/* BEGIN Semibold Italic */ +@font-face { + font-family: 'Open Sans'; + src: url('@{OpenSansPath}/SemiboldItalic/OpenSans-SemiboldItalic.eot'); + src: url('@{OpenSansPath}/SemiboldItalic/OpenSans-SemiboldItalic.eot?#iefix') format('embedded-opentype'), + url('@{OpenSansPath}/SemiboldItalic/OpenSans-SemiboldItalic.woff') format('woff'), + url('@{OpenSansPath}/SemiboldItalic/OpenSans-SemiboldItalic.ttf') format('truetype'), + url('@{OpenSansPath}/SemiboldItalic/OpenSans-SemiboldItalic.svg#OpenSansSemiboldItalic') format('svg'); + font-weight: 600; + font-style: italic; +} + +/* END Semibold Italic */ + +/* BEGIN Bold */ +@font-face { + font-family: 'Open Sans'; + src: url('@{OpenSansPath}/Bold/OpenSans-Bold.eot'); + src: url('@{OpenSansPath}/Bold/OpenSans-Bold.eot?#iefix') format('embedded-opentype'), + url('@{OpenSansPath}/Bold/OpenSans-Bold.woff') format('woff'), + url('@{OpenSansPath}/Bold/OpenSans-Bold.ttf') format('truetype'), + url('@{OpenSansPath}/Bold/OpenSans-Bold.svg#OpenSansBold') format('svg'); + font-weight: bold; + font-style: normal; +} + +/* END Bold */ + +/* BEGIN Bold Italic */ +@font-face { + font-family: 'Open Sans'; + src: url('@{OpenSansPath}/BoldItalic/OpenSans-BoldItalic.eot'); + src: url('@{OpenSansPath}/BoldItalic/OpenSans-BoldItalic.eot?#iefix') format('embedded-opentype'), + url('@{OpenSansPath}/BoldItalic/OpenSans-BoldItalic.woff') format('woff'), + url('@{OpenSansPath}/BoldItalic/OpenSans-BoldItalic.ttf') format('truetype'), + url('@{OpenSansPath}/BoldItalic/OpenSans-BoldItalic.svg#OpenSansBoldItalic') format('svg'); + font-weight: bold; + font-style: italic; +} + +/* END Bold Italic */ + +/* BEGIN Extrabold */ +@font-face { + font-family: 'Open Sans'; + src: url('@{OpenSansPath}/ExtraBold/OpenSans-ExtraBold.eot'); + src: url('@{OpenSansPath}/ExtraBold/OpenSans-ExtraBold.eot?#iefix') format('embedded-opentype'), + url('@{OpenSansPath}/ExtraBold/OpenSans-ExtraBold.woff') format('woff'), + url('@{OpenSansPath}/ExtraBold/OpenSans-ExtraBold.ttf') format('truetype'), + url('@{OpenSansPath}/ExtraBold/OpenSans-ExtraBold.svg#OpenSansExtrabold') format('svg'); + font-weight: 800; + font-style: normal; +} + +/* END Extrabold */ + +/* BEGIN Extrabold Italic */ +@font-face { + font-family: 'Open Sans'; + src: url('@{OpenSansPath}/ExtraBoldItalic/OpenSans-ExtraBoldItalic.eot'); + src: url('@{OpenSansPath}/ExtraBoldItalic/OpenSans-ExtraBoldItalic.eot?#iefix') format('embedded-opentype'), + url('@{OpenSansPath}/ExtraBoldItalic/OpenSans-ExtraBoldItalic.woff') format('woff'), + url('@{OpenSansPath}/ExtraBoldItalic/OpenSans-ExtraBoldItalic.ttf') format('truetype'), + url('@{OpenSansPath}/ExtraBoldItalic/OpenSans-ExtraBoldItalic.svg#OpenSansExtraboldItalic') format('svg'); + font-weight: 800; + font-style: italic; +} + +/* END Extrabold Italic */ \ No newline at end of file diff --git a/views/404.tpl b/views/404.tpl new file mode 100644 index 0000000..e69de29