Skip to content

A php php-framework for small websites for managing files in organized way.

Notifications You must be signed in to change notification settings

Shakir-Bhatt/php-framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tour & Travel

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:

  1. 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>
  1. config folder : Contains database interaction file and connection files and other helper files.
  2. controller: Contains all controller files which are corresponding for each html code file.
  3. include: Contains file which are used at more then one page.
  4. layouts: Here main layout file resides. layout file is used to render other view files.
  5. routes: Contains Routes.php file where we define all routes, view and controllers to use.
  6. storage: Contians files which are generated by code e.g logs and other files.
  7. 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.

Example Usage

Here are steps to use the framework.

  1. Define Database credential in env.php file.
    define('SERVERNAME','servername');
    define('USERNAME','username');
    define('PASSWORD','password');
    define('DBNAME','db_name');
  1. routes/Routes.php File. Define all route names, view and controller files. e.g:
    $routes = [
        'home'=>  ['view' => 'home' , 'controller' => 'homeController'],
        ...
        ...
    ];

Here

  1. 'home' is route name,
  2. 'view' => 'home' is file contains html under views/home.php
  3. 'controller' => 'homeController' is file for php code under controllers/homeController.php

About

A php php-framework for small websites for managing files in organized way.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages