Документация InstantCMS

для администраторов и разработчиков

Инструменты пользователя

Инструменты сайта


en:dev:overview

Introduction

InstantCMS is a modular system developed on the MVC architecture.

Modular blocks, of which the site’s features are composed, are called Components in InstantCMS.

In their turn, each component consists of three main parts: controller, model and templates. A component may contain all these parts as well as any combination of them.

Controllers

A controller is the main part of the component in which all business logic is located. The purpose of a controller is to receive a request from a user, process it and return the result (for example, an HTML-page or JSON).

Each component may have 2 controllers - frontend and backend that work in user and admin parts of the site correspondingly.

Models

A model is a part of a component and contains the logic of extracting, editing and saving the data. The model receives the requests from a controller and returns the results from the database to it, or vice versa, saves the changes in the database.

Templates

Templates are meant for formatting the data before displaying it to a user. The template contains an HTML-markup and a minimum of code - only to the extent necessary to format the output. The data is passed to the template by a controller.

Work Scheme

Each user’s request (opening a page in a browser) initiates the following working process:

  1. index.php file is launched;
  2. Router defines which component was requested and launches its controller;
  3. Controller receives the request parameters from a URL or a form filled by a user;
  4. Controller receives (or saves) the data via model;
  5. Controller processes the data in a proper way;
  6. Controller requests the template and passes the received (or processed) data into it;
  7. Template forms the final HTML-page that is returned to a user.

Thus, the main logic (a greater part of the code) is located inside the controller.

In the next documentation sections, we are going to consider the structure of controllers, models and templates in more detail.


Back to Contents

en/dev/overview.txt · Последнее изменение: 16.03.2017 15:24 — murlysja