定制 draw/sonata-extra-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

draw/sonata-extra-bundle

最新稳定版本:0.36.0

Composer 安装命令:

composer require draw/sonata-extra-bundle

包简介

无描述信息

README 文档

README

This bundle adds some functionalities to the Sonata Project different bundle.

Detect admin argument

The current way to define admin argument is that way:

App\Sonata\Admin\UserAdmin: arguments: [ ~, 'App\Entity\User', ~ ]

You can now omit the constructor argument by setting default value in your constructor class:

namespace App\Sonata\Admin; user App\Entity\User; use Sonata\AdminBundle\Admin\AbstractAdmin; class UserAdmin extends AbstractAdmin { public function __construct($code, $class = User::class, $baseControllerName = null) { parent::__construct($code, $class, $baseControllerName); } }

A compiler will extract the default value from the argument. They need to have the exact same name to be extracted. If you have defined the arguments from any other mean prior to the compiler pass they will not be replaced.

Fix menu depth when only 1 sub menu

When a menu just have one submenu it can be fix to remove the submenu.

This:

User --> List Entity --> List Section --> Entity1 List --> Entity2 List 

Would become:

User Entity Section --> Entity1 List --> Entity2 List 

Enable this feature in config:

draw_sonata_extra: fix_menu_depth: true

New Template types

Some templates type are added to the default Sonata templates.

By default, all the js and css files are added to the sonata_admin.assets.extra_javascripts and `sonata_admin.assets.extra_stylesheets section.

If you want to install them manually you can set the draw_sonata_extra.install_assets to false.

Show

json

Allow to display a json data based on the https://github.com/abodelot/jquery.json-viewer.

If you want to import the assets via webpack you must import this:

import 'jquery.json-viewer/json-viewer/jquery.json-viewer.js'; import 'jquery.json-viewer/json-viewer/jquery.json-viewer.css'; import '../public/bundles/drawsonataextra/js/json_viewer.js';

Note: Don't forget to install the jquery.json-viewer package.

统计信息

  • 总下载量: 43.92k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固