Skip to content
dbald edited this page Sep 15, 2010 · 3 revisions

Structure

Home > Structure

Evergreen does have a specific structure that is used mainly to help organize all the files in your project so that it is easy to always know where things should be across projects. A lot of the structure of Evergreen is optional and many of the folders may be empty in most of your projects.

The structure is explained as:

  • Branches: The branches folder is a holder for one of the main features of the framework. The idea behind branches is that you may want your site to be modular or have pieces of your site that are separate from the rest with it’s own code such as a CMS component. With branches you can have a CMS that is almost completely self contained with it’s own config, helpers, controllers, models, plugins, views, and public areas. A branch can, however, use resources from the main framework files and the main framework files can use resources from the branches allowing you the freedom to integrate the pieces as you please.
  • Config: The config folder holds all the configuration settings for the framework including all the pre-defined errors. Usually there are only 2 files in this folder, config.php and errors.php.
  • Controllers: The controllers folder holds the controller classes for the site. If you were to think of a playing card as a view, or the page that you would actually visit in the browser. Then a controller would be a deck of cards, in that a controller holds a group of views. The controller also defines things like global variables, layout, and filters for the group of views.
  • Helpers: The helpers folder holds helper classes which are classes that can be used to hold functionality that you would want to reuse and therefore helpers allow that functionality to be abstracted from the controllers.
  • Lib: The lib folder holds all the main classes that make up evergreen and define how the framework runs. You should rarely have to do anything in this folder.
  • Models: The models folder holds the model classes. Each model acts as a representation of a table in the database so that you can interface with the table easier using PHP.
  • Plugins: The plugins folder holds plugins which are very similar to helpers in function except that plugins are intended to be able to have more than one file.
  • Public: The public folder is where you store all the assets for your project such a flash files, images, css, and javascript.
  • Vendors: The vendors folder is an optional folder and is there mainly for use with the custom autoloaders.
  • Views: The views folder is used to store the view files and the layout files for the views defined within the controllers. These are used mainly as templates to display what has been processed in the controller.
Clone this wiki locally