PHPackages                             icanboogie/module - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. icanboogie/module

ActiveLibrary[Framework](/categories/framework)

icanboogie/module
=================

Provides module support to ICanBoogie.

v5.0.0(4y ago)03.3k4BSD-3-ClausePHPPHP &gt;=7.2

Since Oct 24Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ICanBoogie/Module)[ Packagist](https://packagist.org/packages/icanboogie/module)[ Docs](https://icanboogie.org/)[ RSS](/packages/icanboogie-module/feed)WikiDiscussions 6.0 Synced 2mo ago

READMEChangelog (8)Dependencies (13)Versions (18)Used By (4)

Module
======

[](#module)

[![Release](https://camo.githubusercontent.com/e9cedbd1086827c110aa00783f9f3e0b3db54c9fc7b5b6996e035deb9e80a996/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6963616e626f6f6769652f6d6f64756c652e737667)](https://packagist.org/packages/icanboogie/module)[![Code Coverage](https://camo.githubusercontent.com/3260d916bbbc4793b145ec4eb58032057991f5d56cf7d1ba1f6b0ad6ba1dd740/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4943616e426f6f6769652f4d6f64756c652f62616467652e7376673f6272616e63683d362e30)](https://coveralls.io/r/ICanBoogie/Module?branch=6.0)[![Downloads](https://camo.githubusercontent.com/0cacca0b8f748e4f3645048b34685c9a2c164a8717ff0238486ff3ccf3150d14/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6963616e626f6f6769652f6d6f64756c652e737667)](https://packagist.org/packages/icanboogie/module)

This package provides support for modules to the framework [ICanBoogie](https://icanboogie.org).

A module is like a tiny application inside your application. It provides its own configurations, routes, operations, views, templates… it contains everything it needs to execute a desired functionality.

#### Installation

[](#installation)

```
composer require icanboogie/module
```

Defining a module
-----------------

[](#defining-a-module)

It takes at least two files to define a module: a configuration fragment and a module class. The configuration fragment is a `module.php` file located in the `config` directory. The class is usually located in the file `lib/Module.php`. The module directory is usually named with the identifier of the module.

The following directory structure demonstrates how a very basic `nodes` module could be defined:

```
nodes
├─ config
│  └─ module.php
└─ lib
   └─ Module.php

```

The following directory structure demonstrates a more advanced module:

```
nodes
├─ config
│  └─ module.php
|  └─
├─ lib
|  ├─ Operation
|  |  └─
|  └─ Module.php
├─ locale
|  └─
├─ public
|  └─
├─ tests
|  └─
└─ templates
   └─

```

### The configuration fragment

[](#the-configuration-fragment)

The configuration fragment describes the module and its models. At the very least the identifier and the class of the module must be defined. The modules configuration takes care of verifying module relationships integrity, computing module weights, and sorting modules according to their weight.

The following code could be a configuration fragment for a "nodes" module.

```
