izica/select-tree-view-for-backpack
最新稳定版本:1.0.5
Composer 安装命令:
composer require izica/select-tree-view-for-backpack
包简介
Select tree view
关键字:
README 文档
README
Installation
composer require izica/select-tree-view-for-backpack
Usage
Table structure examples
catalog-category
- id
- name
- catalog_category_id
catalog-product
- id
- name
- catalog_category_id
Code
protected function setupCreateOperation() { CRUD::addField([ 'view_namespace' => 'izica::fields', // don't modify this field // REQUIRED 'type' => 'select_tree_view', 'label' => "Catalog category", 'name' => 'catalog_category_id', // in product view 'options' => CatalogCategory::get()->toArray(), // or in category view, with preventing loops on itself 'options' => CatalogCategory::whereNot('id', $this->crud->getCurrentEntryId())->get()->toArray(), // OPTIONAL 'options_parent_id' => 'catalog_category_id', // using value from 'name' param by default 'depth_prefix' => '. ', //default value 'depth_max' => 10, //default value 'options_root_id' => null, //default value 'options_sort_by' => 'name', //default value 'option_name' => 'name', //default value 'allows_null' => true, //default value 'default' => null, //default value ]); }
To prevent loops you
统计信息
- 总下载量: 57
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-08-09
