Directories

... by Bittle in PHP Slim Propel XAMPP November 13, 2018

Overview

The directory structure that all projects must follow for readability and consistency.

Structure explanation

app directory: contains the slim controllers and the views

  • controllers directory: Slim route organization (not necessary for small projects)
  • views directory: all php views

data directory: contains files concerning the database

  • generated-conf directory: contains propel's config.php with connection configurations
  • generated-sql directory: contains default sql dump (no insertions)

html directory: contains files accessible directly to the user (anything that doesn't require protection)

  • css/fonts/img/js directories: files that correspond to css, font, images, and javascript files in that order
  • .htaccess file: used to remove index.php from the url
  • index.php file: main entrance point

notes directory: contains any updates of work or explanation

vendor directory: contains dependencies downloaded with composer (not shown in the pic)

composer.(json/lock) file: created by composer

propel.yml[.dist] file: created by propel to define a connection

README.md file: short project description

config.php file: contains the array needed for slim settings, and other functions that should be available globally


Directory notes

Window uses \ as a path delimiter, while Unix-based machines use /, for the following commands concerning paths (such as vendor/bin/propel init) make sure to use the path separator corresponding to your machine. Keep in mind that the directory structure is used to keep projects organized, and is subject to tweaks, but the main structure will stay relatively similar from project to project.

Comments (1)

Search Here