Skip to content
Yuriy edited this page Feb 7, 2016 · 1 revision

As mentioned in description of CMF, Lucent has module structure and this system let you some tools to create your own module. This guide can help you to create your first CMF Lucent module

Modules are self-contained software units that consist of models, views, controllers, and other supporting components. Modules are often viewed as mini-applications.

Creating module

In app directory create a folder whose name have to be equal your module’s name.

app/test

In folder create directories controller, models and views (for more information about controllers, models and view see todo link)

app/test/controller app/test/model app/test/view

To do things work you must create configuration json file in module root. Configuration file has to be named according to some rules:

modulename_info

app/test/test_info.json

You have to specify some necessary information here:

{ "name" : "test", "description" : "Test module", "version" : "1.0", "core_version" : "1.0", }

Where name has to be equal with name of module folder

Now if you go to “admin/panel/modules” you can see your module in “User module” tab.

Create controller (i.e generalController) in app/test/controller folder and create action, for instance “index”

class generalController extends SysController { public function actionIndex() { $view = new SysView(); $view->display('index'); } }

Create a view in app/test/view/general/index. Go to “test/general/” url (or test/general/index) to see the result.

Clone this wiki locally