app architecture
-
includes
-->classes (define all the classess of the app)
-->config.php (define all settings of the app)
-->bootstrap.php (inludes all classes and config file)
-->functions (Dir Including Common functions that will be used whole site) -
themes
-->CSS
-->JS -
images
-
API (define libraries or SDK)
-
templates (global layout of the app)
for any new file always include bootstrap.php
require (dirname(__FILE__) . '/includes/bootstrap.php');
for any class ,no need to connect to db ,always start the new methode with global $db
exemple:
function printUsers() //print all users on db
{
global $db;
return $db->get('users'); // we use a prebuilt function from the MysqlDB class check out the documentation
}We use a prebuilt database class for fast implementation of function check out the documentation https://github.com/joshcam/PHP-MySQLi-Database-Class
the theme path is defined as global vraible path in the config.php (default css,js are bootstrap files)
define("css_path", path."/themes/css/bootstrap.min.css");
Link to CSS file
<link rel="stylesheet" type="text/css" href=<?php echo css_path; ?>>
In this Dir you can define the default structure of the page header,footer,content .The default page is layout.php with css/js links.
This software is developed during my free time and I will be glad if somebody will support me.
For another projects and articles visite my blog https://nodeme.blogspot.com/