Skip to content

XELOS module structure

New XELOS modules will be in the folder XELOS_root/vendor/<your_company>/modules/<your_module>, e.g. the module acme/my_first_module was created at XELOS_root/vendor/example/modules/my_module.

Folder class

The class folder contains your module controller and it might contain classes for crons and daemons, see the coding conventions for more details.

Example module folder structure

Folder setup

The kickstarter generates automatically PHPDocs for your models, pages and actions in the folder docs/class_generated.

See the IDE settings for autocompletion of the YAML files.

config.yml

This file contains information about your module, e.g. its name pages and provided hooks. Please check the generated YAML file for details.

database.yml

The database.yml contains the definitions for each table, e.g. from the blueend/example_survey module:

_meta:
  version: 1
  module: example_survey

survey:
  id:
  title: {type: varchar, size: 80}
  start_date: {type: timestamp}
  end_date:  {type: timestamp}
  active: {type: tinyint, default: '1'}
  question: {type: text}
  user_id:
  created_at: 
  updated_at:

participant:
  id:
  user_id:
  survey_id:
  created_at:

answer:
  id:
  user_id:
  survey_id:
  question_id: {type: varchar, size: 40}
  value: {type: text}
  • _meta contains the module information.
  • Each following first-level entry defines the table name, e.g. survey, participant.