├── README.textile ├── app ├── controllers │ ├── ApplicationController.php │ ├── ErrorController.php │ └── TestController.php ├── models │ └── README └── views │ ├── layouts │ └── layout.phtml │ └── scripts │ ├── error │ └── error.phtml │ └── test │ └── index.phtml ├── config ├── db.inc.php ├── environment.inc.php ├── routes.php └── settings.ini ├── lib ├── README └── base │ ├── Controller.php │ ├── Model.php │ ├── Request.php │ ├── Router.php │ └── View.php └── web ├── .htaccess ├── images └── README ├── index.php ├── javascripts └── README └── stylesheets └── README /README.textile: -------------------------------------------------------------------------------- 1 | h1. Important note! 2 | 3 | Versions 0.3.0, 0.3.1 and 0.3.2 are broken. 4 | 5 | Please switch to version 0.3.3 if you experience any problems 6 | 7 | h1. About 8 | 9 | A structure I use to get started with PHP projects. 10 | 11 | It enables the developer to hook up plugins and let's you use pretty URLs 12 | 13 | h2. Test it! 14 | 15 | * To test this project, just download the zip (or tar.gz, or fork it etc). 16 | * Place it in your web servers root (remember to include the .htaccess file!). 17 | * start your web server and head to: http://localhost/web/test 18 | 19 | 20 | h1. Usage 21 | 22 | I've added some README files in the various folders. 23 | 24 | The web/index.php is the heart of the system. 25 | _This means that your web applications root folder is the "web" folder._ 26 | 27 | All requests go through this file and it decides how the routing of the app 28 | should be. 29 | You can add additional hooks in this file to add certain routes etc (a better 30 | system for this will arrive one day). 31 | 32 | h2. Structure 33 | 34 | The root of the project holds a few directories: 35 | /app - This is the folder where your magic will happen. Use the views, controllers and models folder for your app code. 36 | /config - this folder holds a few configuration files. Currently only the connection to the database. 37 | /lib - This is where you should put external libraries and other external files. 38 | /lib/base - The library files. Don't change these :) 39 | /web - This folder holds files that are to be "downloaded" from your app. Stylesheets, javascripts and images used. (and more of course) 40 | 41 | The system uses a basic MVC structure, with your web app's files located in the 42 | "app" folder. 43 | 44 | h3. app/controllers 45 | 46 | Your application's controllers should be defined here. 47 | * All controller names should end with "Controller". E.g. TestController. 48 | * All controllers should inherit the library's "Controller" class. 49 | 50 | However, you should generally just make an ApplicationController, which extends 51 | the Controller. Then you can defined beforeFilters etc in that, which will get run 52 | at every request. 53 | 54 | h3. app/models 55 | 56 | Models handles database interaction etc. 57 | * All models should inherit from the Model class, which provides basic functionality. 58 | 59 | The Model class handles basic functionality such as: 60 | * Setting up a database connection (using PDO) 61 | * fetchOne(ID) 62 | * save(array) -> both update/create 63 | * delete(ID) 64 | 65 | h3. app/views 66 | 67 | Your view files. 68 | The structure is made so that having a controller named TestController, it looks 69 | in the app/views/test/ folder for it's view files. 70 | 71 | * All view files end with .phtml 72 | 73 | Having an action in the TestController called index, the view file 74 | app/views/test/index.phtml will be rendered as default. 75 | 76 | h3. config/routes.php 77 | 78 | Your routes around the system needs to be defined here. 79 | A route consists of the URL you want to call + the controller#action you want it 80 | to hit. 81 | 82 | An example is: 83 | $routes = array( 84 | '/test' => 'test#index' // this will hit the TestController's indexAction method. 85 | ); 86 | 87 | h3. Error handling 88 | 89 | A general error handling has been added. 90 | 91 | * If a route doesn't exist, then the error controller is hit. 92 | * If some other exception was thrown, the error controller is hit. 93 | 94 | As default, the error controller just shows the exception occured, so remember 95 | to style the error controller's view file (app/views/error/error.phtml) 96 | 97 | h1. Changelog 98 | 99 | I'll start having changelog information at the bottom of this page. 100 | 101 | h2. Version 0.6 102 | * Completely revised system with controllers, models and views. 103 | * New router added. 104 | * You now have to define routes 105 | * added a config/setting.ini file, where you define database settings (password etc) 106 | 107 | h2. Version 0.3.3 108 | 109 | * Added the missing vendor folder. 110 | * Fixed an error with exposing the application root (.htaccess file fix). 111 | * Fixed an error where all files in the vendor scripts folder was read into the system. Only .php files are now read. -------------------------------------------------------------------------------- /app/controllers/ApplicationController.php: -------------------------------------------------------------------------------- 1 | _exception = $exception; 18 | } 19 | 20 | /** 21 | * The error action, which is called whenever there is an error on the site 22 | */ 23 | public function errorAction() 24 | { 25 | // sets the 404 header 26 | header("HTTP/1.0 404 Not Found"); 27 | 28 | // sets the error to be rendered in the view 29 | $this->view->error = $this->_exception->getMessage(); 30 | 31 | // logs the error to the log 32 | error_log($this->view->error); 33 | error_log($this->_exception->getTraceAsString()); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/controllers/TestController.php: -------------------------------------------------------------------------------- 1 | view->message = "hello from test::index"; 8 | } 9 | 10 | public function checkAction() 11 | { 12 | echo "hello from test::check"; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /app/models/README: -------------------------------------------------------------------------------- 1 | Place your models in this folder. 2 | 3 | Please follow the naming convention: 4 | ModelName.class.php 5 | 6 | These will be loaded automatically using the __autoload function in the 7 | app/router.php file -------------------------------------------------------------------------------- /app/views/layouts/layout.phtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | content(); ?> 7 | 8 | -------------------------------------------------------------------------------- /app/views/scripts/error/error.phtml: -------------------------------------------------------------------------------- 1 | error; ?> -------------------------------------------------------------------------------- /app/views/scripts/test/index.phtml: -------------------------------------------------------------------------------- 1 | content from the test/index.phtml file :) -------------------------------------------------------------------------------- /config/db.inc.php: -------------------------------------------------------------------------------- 1 | 23 | -------------------------------------------------------------------------------- /config/environment.inc.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jimmiw/php-mvc-base/4f91ff312eae95348b8aa3fa07e8526c2b9ddd27/config/environment.inc.php -------------------------------------------------------------------------------- /config/routes.php: -------------------------------------------------------------------------------- 1 | 'index#index', 10 | * '/calendar' => 'calendar#index' 11 | */ 12 | $routes = array( 13 | '/test' => 'test#index' 14 | ); 15 | -------------------------------------------------------------------------------- /config/settings.ini: -------------------------------------------------------------------------------- 1 | [database] 2 | driver = mysql 3 | host = 127.0.0.1 4 | dbname = my_database 5 | user = root 6 | password = 12345 -------------------------------------------------------------------------------- /lib/README: -------------------------------------------------------------------------------- 1 | This folder contains the php-mvc-base scripts. 2 | 3 | Your custom scripts should go into the "vendor" folder -------------------------------------------------------------------------------- /lib/base/Controller.php: -------------------------------------------------------------------------------- 1 | view = new View(); 25 | 26 | $this->view->settings->action = $this->_action; 27 | $this->view->settings->controller = strtolower(str_replace('Controller', '', get_class($this))); 28 | } 29 | 30 | /** 31 | * These filters are run BEFORE the action is run 32 | */ 33 | public function beforeFilters() 34 | { 35 | // no standard filers 36 | } 37 | 38 | /** 39 | * These filters are run AFTER the action is run 40 | */ 41 | public function afterFilters() 42 | { 43 | // no standard filers 44 | } 45 | 46 | /** 47 | * The main entry point into the controller execution path. The parameter 48 | * taken is the action to execute. 49 | * @param string $action the action to execute 50 | * @throws Exception 51 | */ 52 | public function execute($action = 'index') 53 | { 54 | // stores the current action 55 | $this->_action = $action; 56 | 57 | // initializes the controller 58 | $this->init(); 59 | 60 | // executes the before filters 61 | $this->beforeFilters(); 62 | 63 | // adds the action suffix to the function to call 64 | $actionToCall = $action.'Action'; 65 | 66 | // executes the action 67 | $this->$actionToCall(); 68 | 69 | // executes the after filterss 70 | $this->afterFilters(); 71 | 72 | // renders the view 73 | $this->view->render($this->_getViewScript($action)); 74 | } 75 | 76 | /** 77 | * fetches the view script for the given action 78 | * @param string $action 79 | * @return string the path to the view script 80 | */ 81 | protected function _getViewScript($action) 82 | { 83 | // fetches the current controller executed 84 | $controller = get_class($this); 85 | // removes the "Controller" part and adds the action name to the path 86 | $script = strtolower(substr($controller, 0, -10) . '/' . $action . '.phtml'); 87 | // returns the script to render 88 | return $script; 89 | } 90 | 91 | /** 92 | * The base url is used if the application is located in a subfolder. Use 93 | * this function when linking to things. 94 | * @return string the baseUrl for the application. 95 | */ 96 | protected function _baseUrl() 97 | { 98 | return WEB_ROOT; 99 | } 100 | 101 | /** 102 | * Fetches the current request 103 | * @return Request 104 | */ 105 | public function getRequest() 106 | { 107 | // initializes the request object 108 | if ($this->_request == null) { 109 | $this->_request = new Request(); 110 | } 111 | 112 | return $this->_request; 113 | } 114 | 115 | /** 116 | * A way to access the current request parameters 117 | * @param string $key the key to look for 118 | * @param mixed $default the default value, else null 119 | * @return mixed 120 | */ 121 | protected function _getParam($key, $default = null) 122 | { 123 | // tests against the named parameters first 124 | if (isset($this->_namedParameters[$key])) { 125 | return $this->_namedParameters[$key]; 126 | } 127 | 128 | // tests against the GET/POST parameters 129 | return $this->getRequest()->getParam($key, $default); 130 | } 131 | 132 | /** 133 | * Fetches all the current parameters 134 | * @return array a list of all the parameters 135 | */ 136 | protected function _getAllParams() 137 | { 138 | return array_merge($this->getRequest()->getAllParams(), $this->_namedParameters); 139 | } 140 | 141 | public function addNamedParameter($key, $value) 142 | { 143 | $this->_namedParameters[$key] = $value; 144 | } 145 | } 146 | -------------------------------------------------------------------------------- /lib/base/Model.php: -------------------------------------------------------------------------------- 1 | _dbh = new PDO( 20 | sprintf( 21 | "%s:host=%s;dbname=%s", 22 | $settings['database']['driver'], 23 | $settings['database']['host'], 24 | $settings['database']['dbname'] 25 | ), 26 | $settings['database']['user'], 27 | $settings['database']['password'], 28 | array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8") 29 | ); 30 | 31 | $this->init(); 32 | } 33 | 34 | public function init() 35 | { 36 | 37 | } 38 | 39 | /** 40 | * Sets the database table the model is using 41 | * @param string $table the table the model is using 42 | */ 43 | protected function _setTable($table) 44 | { 45 | $this->_table = $table; 46 | } 47 | 48 | public function fetchOne($id) 49 | { 50 | $sql = 'select * from ' . $this->_table; 51 | $sql .= ' where id = ?'; 52 | 53 | $statement = $this->_dbh->prepare($sql); 54 | $statement->execute(array($id)); 55 | 56 | return $statement->fetch(PDO::FETCH_OBJ); 57 | } 58 | 59 | /** 60 | * Saves the current data to the database. If an key named "id" is given, 61 | * an update will be issued. 62 | * @param array $data the data to save 63 | * @return int the id the data was saved under 64 | */ 65 | public function save($data = array()) 66 | { 67 | $sql = ''; 68 | 69 | $values = array(); 70 | 71 | if (array_key_exists('id', $data)) { 72 | $sql = 'update ' . $this->_table . ' set '; 73 | 74 | $first = true; 75 | foreach($data as $key => $value) { 76 | if ($key != 'id') { 77 | $sql .= ($first == false ? ',' : '') . ' ' . $key . ' = ?'; 78 | 79 | $values[] = $value; 80 | 81 | $first = false; 82 | } 83 | } 84 | 85 | // adds the id as well 86 | $values[] = $data['id']; 87 | 88 | $sql .= ' where id = ?';// . $data['id']; 89 | 90 | $statement = $this->_dbh->prepare($sql); 91 | return $statement->execute($values); 92 | } 93 | else { 94 | $keys = array_keys($data); 95 | 96 | $sql = 'insert into ' . $this->_table . '('; 97 | $sql .= implode(',', $keys); 98 | $sql .= ')'; 99 | $sql .= ' values ('; 100 | 101 | $dataValues = array_values($data); 102 | $first = true; 103 | foreach($dataValues as $value) { 104 | $sql .= ($first == false ? ',?' : '?'); 105 | 106 | $values[] = $value; 107 | 108 | $first = false; 109 | } 110 | 111 | $sql .= ')'; 112 | 113 | $statement = $this->_dbh->prepare($sql); 114 | if ($statement->execute($values)) { 115 | return $this->_dbh->lastInsertId(); 116 | } 117 | } 118 | 119 | return false; 120 | } 121 | 122 | /** 123 | * Deletes a single entry 124 | * @param int $id the id of the entry to delete 125 | * @return boolean true if all went well, else false. 126 | */ 127 | public function delete($id) 128 | { 129 | $statement = $this->_dbh->prepare("delete from " . $this->_table . " where id = ?"); 130 | return $statement->execute(array($id)); 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /lib/base/Request.php: -------------------------------------------------------------------------------- 1 | isPost()) { 31 | if(isset($_POST[$key])) { 32 | return $_POST[$key]; 33 | } 34 | } 35 | else if ($this->_isGet()) { 36 | if(isset($_GET[$key])) { 37 | return $_GET[$key]; 38 | } 39 | } 40 | 41 | return $default; 42 | } 43 | 44 | /** 45 | * Returns a list of parameters given in the current request 46 | * @return array the params given 47 | */ 48 | public function getAllParams() 49 | { 50 | if ($this->isPost()) { 51 | return $_POST; 52 | } 53 | else if ($this->_isGet()) { 54 | return $_GET; 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /lib/base/Router.php: -------------------------------------------------------------------------------- 1 | _getSimpleRoute($routes, $controller, $action); 24 | 25 | if (!$routeFound) { 26 | // tries to find the a matching "parameter route" 27 | $routeFound = $this->_getParameterRoute($routes, $controller, $action); 28 | } 29 | 30 | // no route found, throw an exception to run the error controller 31 | if (!$routeFound || $controller == null || $action == null) { 32 | throw new Exception('no route added for ' . $_SERVER['REQUEST_URI']); 33 | } 34 | else { 35 | // executes the action on the controller 36 | $controller->execute($action); 37 | } 38 | } 39 | catch(Exception $exception) { 40 | // runs the error controller 41 | $controller = new ErrorController(); 42 | $controller->setException($exception); 43 | $controller->execute('error'); 44 | } 45 | } 46 | 47 | /** 48 | * Tests if a route has parameters 49 | * @param string $route the route (uri) to test 50 | * @return boolean 51 | */ 52 | public function hasParameters($route) 53 | { 54 | return preg_match('/(\/:[a-z]+)/', $route); 55 | } 56 | 57 | /** 58 | * Fetches the current URI called 59 | * @return string the URI called 60 | */ 61 | protected function _getUri() 62 | { 63 | $uri = explode('?',$_SERVER['REQUEST_URI']); 64 | $uri = $uri[0]; 65 | $uri = substr($uri, strlen(WEB_ROOT)); 66 | 67 | return $uri; 68 | } 69 | 70 | /** 71 | * Tries to find a matching simple route 72 | * @param array $routes the list of routes in the system 73 | * @param Controller $controller the controller to use (sent as reference) 74 | * @param string $action the action to execute (sent as reference) 75 | * @return boolean 76 | */ 77 | protected function _getSimpleRoute($routes, &$controller, &$action) 78 | { 79 | // fetches the URI 80 | $uri = $this->_getUri(); 81 | 82 | // if the route isn't defined, try to add a trailing slash 83 | if (isset($routes[$uri])) { 84 | $routeFound = $routes[$uri]; 85 | } 86 | else if(isset($routes[$uri . '/'])) { 87 | $routeFound = $routes[$uri . '/']; 88 | } 89 | else { 90 | $uri = substr($uri, 0, -1); 91 | // fetches the current route 92 | $routeFound = isset($routes[$uri]) ? $routes[$uri] : false; 93 | } 94 | 95 | // if a matching route was found 96 | if ($routeFound) { 97 | list($name, $action) = explode('#', $routeFound); 98 | 99 | // initializes the controller 100 | $controller = $this->_initializeController($name); 101 | 102 | return true; 103 | } 104 | 105 | return false; 106 | } 107 | 108 | /** 109 | * Tries to find a matching parameter route 110 | * @param array $routes the list of routes in the system 111 | * @param Controller $controller the controller to use (sent as reference) 112 | * @param string $action the action to execute (sent as reference) 113 | * @return boolean 114 | */ 115 | protected function _getParameterRoute($routes, &$controller, &$action) 116 | { 117 | // fetches the URI 118 | $uri = $this->_getUri(); 119 | 120 | // testing routes with parameters 121 | foreach ($routes as $route => $path) { 122 | if ($this->hasParameters($route)) { 123 | $uriParts = explode('/:', $route); 124 | 125 | $pattern = '/^'; 126 | //$pattern .= '\\'.($uriParts[0] == '' ? '/' : $uriParts[0]); 127 | if ($uriParts[0] == '') { 128 | $pattern .= '\\/'; 129 | } 130 | else { 131 | $pattern .= str_replace('/', '\\/', $uriParts[0]); 132 | } 133 | 134 | foreach (range(1, count($uriParts)-1) as $index) { 135 | $pattern .= '\/([a-zA-Z0-9]+)'; 136 | } 137 | 138 | // now also handles ending slashes! 139 | $pattern .= '[\/]{0,1}$/'; 140 | 141 | $namedParameters = array(); 142 | $match = preg_match($pattern, $uri, $namedParameters); 143 | // if the route matches 144 | if ($match) { 145 | list($name, $action) = explode('#', $path); 146 | 147 | // initializes the controller 148 | $controller = $this->_initializeController($name); 149 | 150 | // adds the named parameters to the controller 151 | foreach (range(1, count($namedParameters)-1) as $index) { 152 | $controller->addNamedParameter( 153 | $uriParts[$index], 154 | $namedParameters[$index] 155 | ); 156 | } 157 | 158 | return true; 159 | } 160 | } 161 | } 162 | 163 | return false; 164 | } 165 | 166 | /** 167 | * Initializes the given controller 168 | * @param string $name the name of the controller 169 | * @return mixed null if error, else a controller 170 | */ 171 | protected function _initializeController($name) 172 | { 173 | // initializes the controller 174 | $controller = ucfirst($name) . 'Controller'; 175 | // constructs the controller 176 | return new $controller(); 177 | } 178 | } 179 | -------------------------------------------------------------------------------- /lib/base/View.php: -------------------------------------------------------------------------------- 1 | settings = new stdClass(); 29 | } 30 | 31 | /** 32 | * Renders the view script, and stores the output 33 | */ 34 | protected function _renderViewScript($viewScript) 35 | { 36 | // starts the output buffer 37 | ob_start(); 38 | 39 | // includes the view script 40 | include(ROOT_PATH . '/app/views/scripts/' . $viewScript); 41 | 42 | // returns the content of the output buffer 43 | $this->_content = ob_get_clean(); 44 | } 45 | 46 | /** 47 | * Fetches the content of the current view script 48 | */ 49 | public function content() 50 | { 51 | return $this->_content; 52 | } 53 | 54 | /** 55 | * Renders the current view. 56 | */ 57 | public function render($viewScript) 58 | { 59 | if ($viewScript && $this->_viewEnabled) { 60 | // renders the view script 61 | $this->_renderViewScript($viewScript); 62 | } 63 | 64 | if ($this->_isLayoutDisabled()) { 65 | echo $this->_content; 66 | } 67 | else { 68 | // includes the current view, which uses the "$this->content()" to output the 69 | // view script that was just rendered 70 | include(ROOT_PATH . '/app/views/layouts/' . $this->_getLayout() . '.phtml'); 71 | } 72 | } 73 | 74 | /** 75 | * Renders the given data as json 76 | * @param mixed $data 77 | */ 78 | public function renderJson($data) 79 | { 80 | $this->disableView(); 81 | $this->disableLayout(); 82 | 83 | // sets the json headers 84 | header('Cache-Control: no-cache, must-revalidate'); 85 | header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); 86 | header('Content-type: application/json'); 87 | 88 | echo json_encode($data); 89 | } 90 | 91 | protected function _getLayout() 92 | { 93 | return $this->_layout; 94 | } 95 | 96 | public function setLayout($layout) 97 | { 98 | $this->_layout = $layout; 99 | 100 | if ($layout) { 101 | $this->_enableLayout(); 102 | } 103 | } 104 | 105 | public function disableLayout() 106 | { 107 | $this->_layoutEnabled = false; 108 | } 109 | 110 | public function disableView() 111 | { 112 | $this->_viewEnabled = false; 113 | } 114 | 115 | /** 116 | * stores the given data on the given key 117 | * @param string $key the key to store the data under 118 | * @param mixed $value the value to store 119 | */ 120 | public function __set($key, $value) 121 | { 122 | // stores the data 123 | $this->_data[$key] = $value; 124 | } 125 | 126 | /** 127 | * Returns the data if it exists, else nul 128 | * @param string $key the data to look for 129 | * @return mixed the data found or null 130 | */ 131 | public function __get($key) 132 | { 133 | if (array_key_exists($key, $this->_data)) { 134 | return $this->_data[$key]; 135 | } 136 | 137 | return null; 138 | } 139 | 140 | /** 141 | * The base url is used if the application is located in a subfolder. Use 142 | * this function when linking to things. 143 | * @return string the baseUrl for the application. 144 | */ 145 | public function baseUrl() 146 | { 147 | return WEB_ROOT; 148 | } 149 | 150 | /** 151 | * Adds a new javascript to the header. 152 | * @param string $script the path to the script to add 153 | */ 154 | public function appendScript($script) 155 | { 156 | $this->_javascripts .= '' ."\n"; 157 | } 158 | 159 | /** 160 | * Prints the included javascripts 161 | */ 162 | public function printScripts() 163 | { 164 | echo $this->_javascripts; 165 | } 166 | 167 | /** 168 | * Sets the layout to be used 169 | */ 170 | protected function _enableLayout() 171 | { 172 | $this->_layoutEnabled = true; 173 | } 174 | 175 | /** 176 | * Tests if the layout is disabled 177 | */ 178 | protected function _isLayoutDisabled() 179 | { 180 | return !$this->_layoutEnabled; 181 | } 182 | } 183 | -------------------------------------------------------------------------------- /web/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | RewriteEngine On 3 | 4 | # Parse requests that doesn't map to real files 5 | RewriteCond %{REQUEST_FILENAME} -s [OR] 6 | RewriteCond %{REQUEST_FILENAME} -l 7 | RewriteRule ^.*$ - [NC,L] 8 | RewriteRule ^.*$ index.php [NC,L] 9 | 10 | -------------------------------------------------------------------------------- /web/images/README: -------------------------------------------------------------------------------- 1 | Place your images in this folder. -------------------------------------------------------------------------------- /web/index.php: -------------------------------------------------------------------------------- 1 | 10 && substr($className, -10) == 'Controller') { 27 | if (file_exists(ROOT_PATH . '/app/controllers/' . $className . '.php') == 1) { 28 | require_once ROOT_PATH . '/app/controllers/' . $className . '.php'; 29 | } 30 | } 31 | else { 32 | if (file_exists(CMS_PATH . $className . '.php')) { 33 | require_once CMS_PATH . $className . '.php'; 34 | } 35 | else if (file_exists(ROOT_PATH . '/lib/' . $className . '.php')) { 36 | require_once ROOT_PATH . '/lib/' . $className . '.php'; 37 | } 38 | else { 39 | require_once ROOT_PATH . '/app/models/'.$className.'.php'; 40 | } 41 | } 42 | } 43 | 44 | // activates the autoloader 45 | spl_autoload_register('autoloader'); 46 | 47 | $router = new Router(); 48 | $router->execute($routes); 49 | -------------------------------------------------------------------------------- /web/javascripts/README: -------------------------------------------------------------------------------- 1 | Place your javascripts in this folder. 2 | 3 | Use the helper functions found in the /includes/functions.php file to find the 4 | correct path in the system. 5 | 6 | h3. Example of usage 7 | 8 | 9 | 10 | 11 | 12 | 13 | Your body data here. 14 | 15 | 16 | 17 | As you can see, the helper function get_javascript needs to be called, with the 18 | script you want to load as parameter. -------------------------------------------------------------------------------- /web/stylesheets/README: -------------------------------------------------------------------------------- 1 | Place your stylesheets in this folder. 2 | 3 | Use the helper functions found in the /includes/functions.php file to find the 4 | correct path in the system. 5 | 6 | h3. Example of usage 7 | 8 | 9 | 10 | 11 | 12 | 13 | Your body data here. 14 | 15 | 16 | 17 | As you can see, the helper function get_stylesheet needs to be called, with the 18 | stylesheet you want to load as parameter. --------------------------------------------------------------------------------