neam / yii-relations-ui
To simplify editing relations in a Yii 1 app
Installs: 193
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii-extension
Requires
- php: >=5.4.0
- neam/yii-handsontable-input: >=1.0.0
- neam/yii-relations-ui-core: *@dev
- yiisoft/yii: >=1.1.0
This package is not auto-updated.
Last update: 2024-12-17 02:48:59 UTC
README
To simplify editing relations in a Yii 1 app.
Current widget
Has-many relation input based on Handsontable.
Use in a Yii 1 app as follows:
$this->widget('\neam\yii_relations_ui\widgets\HasManyHandsontableInput', [ 'model' => $model, 'relation' => 'routes', ]);
Use any customized columns and handsontable settings:
$this->widget('\neam\yii_relations_ui\widgets\HasManyHandsontableInput', [ 'model' => $model, 'relation' => 'routes', 'settings' => [ 'columns' => [ (object) ['data' => 'id'], (object) ['data' => 'route'], (object) ['data' => 'canonical', 'type' => 'checkbox', 'checkedTemplate' => 1, 'uncheckedTemplate' => 0], // example of using checkbox to save an attribute of type BOOLEAN NOT NULL (object) ['data' => 'route_type_id'], (object) ['data' => 'node_id'], (object) ['special' => 'delete_checkbox'], // special virtual column to mark which items should be deleted ] ] ]);
Note: This widget requires Yii <- Yii 2 bridge available at https://github.com/neam/yii-yii2-bridge
Screenshot 1 - A hasMany relation "routes" displayed in handsontable
![Handsontable Screenshot 1](/docs/screenshots/handsontable-screen-1.jpg?raw=true "A hasMany relation "routes" displayed in handsontable")