izica/select-tree-view-for-backpack 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

izica/select-tree-view-for-backpack

最新稳定版本:1.0.5

Composer 安装命令:

composer require izica/select-tree-view-for-backpack

包简介

Select tree view

README 文档

README

  1. Installation
  2. Usage

Alt text

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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: Blade

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-08-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固