File and Folder Conventions

Folders and Files:

  • controllers – Mandatory location of all controller files
  • data – Recommended location for all data files ex. .txt, .sql, etc.
    • tables.sql – Recommended file for creating you MySQL tables
  • includes – Location to place files to be included
    • automatic-include – All PHP files, and PHP files in folders of this folder will automatically be included for every MVC page
    • classes – Recommended location for PHP class definition files
    • functions – Recommended location for PHP function files
    • libraries – Recommended location for PHP library files
    • view_helpers – Recommended location for PHP view_helpers files i.e. Things that help process output
  • models – Mandatory location of all model files
  • public – Location for all publicly accessible files
    • css – Location for CSS files
    • js – Location for JS files
    • scripts – Location for script files i.e. Targets for AJAX calls
    • temp – Location for temporary public files
  • scripts – Location for any script you may use in your application ex. A Python script to automate a task
  • temp – Location for temporary files
  • view – Mandatory location of all view files
  • .htaccess – By default, nothing in the application folder is accessible to the public, besides the public folder
  • config.php – Set timezone, enable/disable debug, enable/disable post resubmission, require JS, set page permissions per role, pre-load CSS, pre-load JS, set if developer role should always see debug, set if developer role should always allow post resubmission,  set if the database should be kept up to date the /data/tables.sql file


Up Next: Using The Library