Skip to content
Everett Griffiths edited this page May 21, 2014 · 2 revisions

One of Repoman's primary goals was a simplified folder structure to save time during development. Below is an outline of the recommended folder structure that should suit most projects.

Reference

  • .gitignore : if you are versioning your work with Git, be sure to ignore vendor/!
  • assets/ : stores any web-accessible assets such as CSS, Javascript, and images. Configurable via the "assets_path" in composer.json
  • composer.json : this is your primary configuration file. Every Repoman project will need this.
  • composer.lock : this file works in tandem with composer.json.
  • controllers/ : this directory is used by custom MODx manager controllers, which are used by custom manager pages (CMPs) and custom resource classes (CRCs).
  • docs/ : here's where you should put your changelog.txt, license.txt, and a readme.txt. Unlike the readme.md file used by Github (see below), this file is plain text and it is displayed to a user prior to installing your package. Other than that, it can contain mostly the same stuff.
  • elements/ : this directory contains sub-folders for your chunks/, plugins/, snippets/, templates/, and tvs/. This is where static elements will be saved during development.
  • index.class.php : This kicks off requests to a CMP and funnels manager requests to the connectors/ directory (only use this if your package supports a CMP).
  • lexicon/ : Contains translation strings. MODx does not allow configuration here: the name and location are fixed.
  • model/ : this directory is the de-facto MODX standard for class files describing your data model and it is used as a base for the "schema:write" and "schema:parse" functions. You can customize this using the "orm_path" setting.
  • readme.md : this file is used by Github et al to describe your package. Do not neglect this important piece of documentation!
  • tests/ : this directory contains unit tests, e.g. used by phpunit. This folder is not included in packaging. You can set an array of directories or files to omit from packaging using the "omit" setting.
  • vendor/ : this directory is where Composer installs package dependencies. You should reference this folder in your .gitignore.

Getting Started

You don't need to memorize the above to use it: just start your projects using Repoman's create function. Use this command to jump-start your project.

Clone this wiki locally