Developer Manuals


Who is this section for?

This section in the Documentation is the Developer Manuals. These manuals are aimed at anybody who is developing for or with PyroCMS

The main thing to know about developing for PyroCMS is that it uses the CodeIgniter MVC framework. While you could probably develop some Add-ons just fine without first learning CodeIgniter it is strongly recommended that you at least read the CodeIgniter User Guide first. While this may seem like extra effort, when you know CodeIgniter you will find creating Add-ons and extensions to be much more logical, structured and tidy than most other CMSs.

Basic Principles

Modules

PyroCMS uses a CodeIgniter extension called Modular Extensions which adds "Modular MVC" or "Modules". This means that you can keep all logic together in a tidy format and easily move code from one installation to another. A module contains a details.php which has all of the "meta-data" and installation instructions for the module. Creating modules is pretty easy when you know how.

Models, Views and Controllers

All modules are based on the Model-View-Controller development pattern. MVC is a software approach that separates application logic from presentation. In practice, it permits your web pages to contain minimal scripting since the presentation is separate from the PHP scripting.

  • The Model represents your data structures. Typically your model classes will contain functions that help you retrieve, insert, and update information in your database.
  • The View is the information that is being presented to a user. A View will normally be a web page, but in CodeIgniter, a view can also be a page fragment like a header or footer. It can also be an RSS page, or any other type of "page".
  • The Controller serves as an intermediary between the Model, the View, and any other resources needed to process the HTTP request and generate a web page.

CodeIgniter (and there PyroCMS) has a fairly loose approach to MVC since Models are not required. If you don't need the added separation, or find that maintaining models requires more complexity than you want, you can ignore them and build your application minimally using Controllers and Views.