Core Functionality Plan and Website File Structure

Core Functionality and Naming Conventions

All core functionality will be provided by using a single functions file to be included site wide. This will be called functions.php and will reside in the core folder.

Each user facing front end page should also be a PHP file. They should be named with their specific function (all required pages will be created as barebones files) and placed in the root directory.

Unless accessible to all users the file should be prefixed with the minimum user allowed to use it. ex: admin_sitesettings.php is the site settings page only to be accessed by admins and above.

As an example file for other naming conventions I will use "login.php". All form submit based functions for a page should follow the convention PAGENAME_FUNCTIONNAME.PHP as an example the login page form function to login would be called login_submitlogin.php this should be placed in the formActions folder.

Any back end files separated from the functions.php for easier code readability or to consolidate functions with similar purposes into one file should be named functions_FUNCTIONGROUPNAME.PHP. For example a database functions page would be called functions_database.php and would also reside in the core folder. Every functions sub file must be referenced with an include in the main functions.php file.

Website File Structure

All front-end files that are user-accessible should be placed in the root directory "/" (in our source code repo we treat the root of the web system as the folder "Core, Website and API"

All back-end files that are the result of a form submit to be actioned upon should be named as above and placed in "/formActions"

All back-end files that contain only functions to be used by other php files should be placed in "/core" and named as above.

All images should be placed in "/images" apart from icons that should be placed in "/images/icons"

Extra .css files should not be added. Simply add what specific class you need to the current .css.

Last edited Sep 8, 2014 at 3:17 PM by melikesPCcheese, version 4


No comments yet.