Skip to content

3 MMIR Project Structure

russa edited this page May 9, 2017 · 6 revisions

MMIR Project Structure

This chapter describes the typical directory structure of a MMIR-based application. Figure 10 shows the structure of StarterKit example. If you are familiar with Cordova (previously PhoneGap), you may have noticed that the structure is similar to Cordova projects (v2.x).


Figure 4: Basic directory structure for a MMIR-based application

Naming Conventions for Models, Views, and Controllers

The framework uses naming conventions in order to keep the configuration simple. Following this convention means, that you use the same name for controller-files (which hold the implementation for the controller), controller-class (the JavaScript class of the controller implementation), and the controller's view directory (the directory which holds all view definitions for the controller) etc.

As a result, you do not have to make additional configurations that tell the framework for instance "view XY for controller AB can be found in location IJ". Instead the framework derives all this information from the controller's name.

  Description Example
[controller name] the controller's class name CalendarExample
\controllers\[controller name].js File name for controller implementation calendarExample.js
\views\[controller name]\[view name].ehtml A view definition for the controller calendarExample\main.ehtml
\views\layouts\[controller name].ehtml Layout definition for the controller's views calendarExample.ehtml
Table 2: Naming convention for controllers and views

The controller's class name should always start with an upper case letter. The file in which the controller's class is specified may begin with a lower case letter, but except for this, must have the same name.


< previous: "What is MMIR" | next: "The WWW Directory" >

Clone this wiki locally