# Module interface

The user interface is described based on the "[Volt: Template Engine](https://docs.phalcon.io/4.0/en/volt#volt-template-engine)".

### Add editable table

The first step is to add a description of the table to **\*Controller.php** class:

```
├── agi-bin
└── App
    └── Controllers
        └── ModuleTemplateController.php
```

In function "**getTablesDescription**" add a description of the table:

```php
   private function getTablesDescription():array
    {
        $description = [];
        $description['QuestionsQuality'] = [
            'cols' => [
                'rowIcon'    => ['header' => '', 'class' => 'collapsing', 'icon' => 'question circle'],
                'priority'   => ['header' => '', 'class' => 'collapsing'],
                'question'   => ['header' => 'Text question',  'class' => 'ten wide'],
                'delButton'  => ['header' => '', 'class' => 'collapsing']
            ],
            'ajaxUrl' => '/getNewRecords',
            'icon' => 'user',
            'needDelButton' => true
        ];

        return $description;
    }
```

* "**QuestionsQuality**" - name of the model class
* "**question**" - name of the property described in the model
* "**priority**" - the name of the property described in the model opens the possibility to change the order of lines in the module interface
* "**delButton**" - service field, adds the"delete" button
* "**icon**" - service field, adds an icon to the beginning of the row

Edit the **index.volt** file:

```php
├── agi-bin
└─── App
    ├── Controllers
    ├── Forms
    └── Views
        └── index.volt
```

Need add:

```php
<div class="ui grid">
    <div class="ui row">
        <div class="ui five wide column">
            {{ link_to("#", '<i class="add user icon"></i>  '~t._('module_phnbk_AddNewRecord'), "class": "ui blue button", "id":"add-new-row", "id-table":"QuestionsQuality-table") }}
        </div>
    </div>
</div>
<br>
<table id="QuestionsQuality-table" class="ui small very compact single line table"></table>
```

* Need replace "**Questions Quality**" with the name of the model class.

Go to the web interface of the module. The table will be displayed

![Table view in the web interface](/files/-MiRTwnNCHnGzQTVHWiN)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mikopbx.com/mikopbx-development/module-developement/module-interface-empty.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
