A modular based mvc framework.
- Composer http://getcomposer.org
- MYSQL
- PHP 5.4
- Create a virtual host pointing to the public folder
<VirtualHost *:80>
DocumentRoot "C:\projects\PinoyPHPFramework\public"
ServerName framework
<Directory C:\projects\PinoyPHPFramework\public>
Options Indexes FollowSymLinks
Order Deny,Allow
Allow from all
AllowOverride all
</Directory>
</VirtualHost
-
Open your command line tool go to the project folder and hit composer update. It will create a folder named vendor.
-
Restart your apache
-
Then visit e.g http://framework
-
Optionally if you do not want to use apache, using your cmd, go to the public folder and run php -S 127.0.0.1:8080
The routes configurations are located at /config/routes.php
<?php
use Framework\Route;
$route = new Framework\Router;
$route->add(array(
new Route('GET', '/test', 'Main\Controllers\DefaultController', 'main'),
new Route('GET', '/test/alp:dave', 'Main\Controllers\DefaultController', 'test')
));
return $route;
Simply add a new Route object. Then add some arguments
Route($method,$pattern,$namespace,$action);
1.$method - POST,GET,PUT etc.
2.$pattern - The url pattern e.g /about
'alp' - Alphabet
'num' - Numeric
'aln' - Alpha Numeric
'rgx' - Regular Expressions
- $namespace - The class namespace e.g Main\Controllers\DefaultController located at modules/main/controllers/DefaultControler.php
- $action - The controllers method
Modules
Contains views, repositories, forms, models and controllers.
Views are the display layer of your module which is the responsible for presentation on the browser. It is consists of html files css and javascripts just like an ordinary web pages.
Models folder is where you put all your model files. The model files are the representation of your table which consists of attributes which are the table columns and some getters and setters.
Database logic classes. Responsible for saving, updating, deleting etc.
This is where you store all your form specific validation classes
Controllers are responsible for receiving a requests and passing, rendering the views and sending responses .