A beta php framework under developement with a foucus of using minimum file to build wesites and web apps..
This is for educational purpose not for sale. You can clone/download the copy for development.
Directory Structure:
- assets folder: you can put your css and js file here and link them in html using asset(); function e.g
<link rel="stylesheet" href="<?= asset('animate.min.css'); ?>">
<script src="<?= asset('jquery-1.11.1.min.js'); ?>"></script>
- config folder : Contains database interaction file and connection files and other helper files.
- controller: Contains all controller files which are corresponding for each html code file.
- include: Contains file which are used at more then one page.
- layouts: Here main layout file resides. layout file is used to render other view files.
- routes: Contains Routes.php file where we define all routes, view and controllers to use.
- storage: Contians files which are generated by code e.g logs and other files.
- views: All the html containing file are put under this folder.
The whole process is handeled by index.php. Any request generated by project goes through this file.
Here are steps to use the framework.
- Define Database credential in env.php file.
define('SERVERNAME','servername');
define('USERNAME','username');
define('PASSWORD','password');
define('DBNAME','db_name');
- routes/Routes.php File. Define all route names, view and controller files. e.g:
$routes = [
'home'=> ['view' => 'home' , 'controller' => 'homeController'],
...
...
];
Here
- 'home' is route name,
- 'view' => 'home' is file contains html under views/home.php
- 'controller' => 'homeController' is file for php code under controllers/homeController.php