Creating my First PHP Framework : Day 2
First things first , i'needed a file (init.php) witch requires all other components of the framework , also all the static variables such as APP and CSS directories so i called it init.php
Also i need to require 3 files
autoload.php : composer's autoloader for project dependicies .
App.php : to simplify things this file loads the controller corresponding to the pages
database.php : simply database configuration for the framework using Cakephp ORM
the framework on girhub
<?php | |
define('ROOT',dirname(__DIR__)); | |
define('APP',ROOT."/app/"); | |
define('WEBROOT',"http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/"); | |
define('CSS',WEBROOT."css/"); | |
define('IMG',WEBROOT."img/"); | |
define('JS',WEBROOT."js/"); | |
define('DS',ROOT."/"); | |
require_once ROOT.'/vendor/autoload.php'; | |
require_once APP.'/core/App.php'; | |
require_once APP.'/database.php'; |
autoload.php : composer's autoloader for project dependicies .
App.php : to simplify things this file loads the controller corresponding to the pages
database.php : simply database configuration for the framework using Cakephp ORM
the framework on girhub
nice
ReplyDelete