Skip to content

Deprecated since 7.2

This page documents the classic module layer (CBController and cbInit()). It still works in every 7.x release, but new code should use resources and pages.

Use instead: Select::make('customer_id')->relationship('customer', 'name').

Datamodal Form Type ​

Showing popup that contains a data table that you can choose

Code Example ​

php
$this->form[] = ['label'=>'Product Name','name'=>'products_id','type'=>'datamodal','datamodal_table'=>'products','datamodal_where'=>'','datamodal_columns'=>'name,description,price','datamodal_columns_alias'=>'Name,Description,Price','required'=>true];

Legend ​

Attribute NameExampleDescription
datamodal_table (Required)E.g : productsTable name
datamodal_columns (Required)E.g : name,description,pricefields name to show. sparate with comma
datamodal_columns_alias (Required)E.g : Name,Description,Pricealias of fields
datamodal_whereE.g : id != 1Sql query where
datamodal_sizeE.g : large or defaultpopup size
datamodal_heightE.g : 500pxmodal height
datamodal_paginateE.g : 10results pagination

What's Next ​

Table Of Contents ​

Released under the MIT License.