Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adamyordan/retard-php-framework
MVC PHP Framework for retards and dummies
https://github.com/adamyordan/retard-php-framework
Last synced: 6 days ago
JSON representation
MVC PHP Framework for retards and dummies
- Host: GitHub
- URL: https://github.com/adamyordan/retard-php-framework
- Owner: adamyordan
- Created: 2016-05-07T10:48:25.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-05-07T10:51:26.000Z (over 8 years ago)
- Last Synced: 2024-11-07T09:43:41.323Z (about 2 months ago)
- Language: PHP
- Homepage:
- Size: 2.93 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Retard - MVC PHP Framework
==========================
MVC Framework for retards and dummiesGuide [Retards]
===============
Step by step to create a page:
- create view
- create a .php file in folder `views`, example: `views/pages/home.php`
- create controller
- create a function in page_controller.php
- doneexample of controller function:
===============================
```
public static function home() {
// calculate stuffs
$age = 2016 - 1996;
$name = $_POST['myname'];// render view
View::render('pages/home', [
'age' => $age,
'name' => $name
]);
}
```example of view file:
```
Hello,
Your age is
```you can open your created page in : `http://localhost/?p=home`
Guide [Retards]
===============
Step by step to create a page:- create view
- create a .php file in folder `views`, example: `views/pages/home.php`- create controller
- create a function in page_controller.php- done
Guide [Dummies]
===============
Step by step to create a page:- create view
- select or make appropriate folder in `views`, example: `views/user`
- create a .php file in folder `views`, example: `views/user/profile.php`- create controller
- select or make appropriate controller in `controllers`, example: `controllers/user_controller.php`
- create a class and function in the controller file, example: `class UserController { . . .}`- registering controller
- add your new controller in `include/routes.php` on `$CONTROLLER_LIST`;- done
Guide [NormalThinker]
===============
Step by step to create a page:- create view
- select or make appropriate folder in `views`, example: `views/user`
- create a .php file in folder `views`, example: `views/user/profile.php`
- use data passed from controller using variable $data, example: `$data['name']`
- make sure to direct your url link with prefix `?p=`, for example: ``
- use data passed from controller using variable `$data`, example: `$data['name']`
- avoid doing calculation in view- create controller
- select or make appropriate controller in `controllers`, example: `controllers/user_controller.php`
- create a class and function in the controller file, example: `class UserController { . . .}`
- do data calculation inside the function, and pass data that are needed for view
- you can get POST and GET request data like usual, example: `$name = $_POST['name'];`- registering controller
- add your new controller in `include/routes.php` on `$CONTROLLER_LIST`;
- you can explicitly direct your route inside the `switch ($route)`, just add new case,
example: `case 'biodata': call('UserController', 'profile'); break;`
- if you do not define it explicitly, the framework will try to check if any function name matches the url request. example: `http://localhost/?p=profile` will use function `profile` in `UserController`- done