netcore / module-category
分类管理模块
这个包的官方仓库似乎已不存在,因此该包已被冻结。
v1.1.1
2019-05-24 06:28 UTC
Requires
- php: >=7.0
- cviebrock/eloquent-sluggable: ^4.3
- kalnoy/nestedset: ^4.2
- dev-master
- 1.1.x-dev
- v1.1.1
- v1.1.0
- 1.0.x-dev
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- 0.1.x-dev
- v0.0.8
- v0.0.7
- v0.0.6
- v0.0.5
- v0.0.4
- v0.0.3
- v0.0.2
- v0.0.1
- dev-dependabot/npm_and_yarn/express-4.18.2
- dev-dependabot/npm_and_yarn/qs-6.3.3
- dev-dependabot/npm_and_yarn/decode-uri-component-0.2.2
- dev-dependabot/npm_and_yarn/loader-utils-1.4.2
- dev-dependabot/npm_and_yarn/follow-redirects-1.14.8
- dev-dependabot/npm_and_yarn/chownr-1.1.4
- dev-dependabot/npm_and_yarn/marked-0.3.19
- dev-dependabot/npm_and_yarn/path-parse-1.0.7
- dev-dependabot/npm_and_yarn/tar-2.2.2
- dev-dependabot/npm_and_yarn/set-getter-0.1.1
- dev-dependabot/npm_and_yarn/dns-packet-1.3.4
- dev-dependabot/npm_and_yarn/hosted-git-info-2.8.9
- dev-dependabot/npm_and_yarn/lodash-4.17.21
- dev-dependabot/npm_and_yarn/y18n-3.2.2
- dev-dependabot/npm_and_yarn/elliptic-6.5.4
- dev-dependabot/npm_and_yarn/axios-0.21.1
- dev-dependabot/npm_and_yarn/ini-1.3.7
- dev-dependabot/npm_and_yarn/http-proxy-1.18.1
- dev-dependabot/npm_and_yarn/node-sass-4.14.1
- dev-dependabot/npm_and_yarn/lodash.mergewith-4.6.2
- dev-dependabot/npm_and_yarn/elliptic-6.5.3
- dev-dependabot/npm_and_yarn/lodash-4.17.19
- dev-dependabot/npm_and_yarn/websocket-extensions-0.1.4
- dev-dependabot/npm_and_yarn/jquery-3.5.0
This package is not auto-updated.
Last update: 2024-08-18 03:45:04 UTC
README
本模块旨在简化分类管理。
功能
- 一切可翻译
- 每个分类都有slug,允许手动slug
- 拖放支持重新排序
预安装
此模块是Netcore CMS生态系统的一部分,仅在已安装以下包的项目中有效
- https://github.com/netcore/netcore
- https://github.com/netcore/module-admin
- https://github.com/netcore/module-translate
安装
- 使用composer安装此包
composer require netcore/module-category
- 发布 assets/configuration/migrations
php artisan module:publish Category
php artisan module:publish-config Category
php artisan module:publish-migration Category
php artisan migrate
配置
- 配置文件位于 config/netcore/module-category.php
分类组
- 分类组不能从管理员控制面板中编辑。您应该初始化它们。
// DatabaseSeeder.php: // For select2 type, you should create presenter first, read below about presenters. CategoryGroup::create([ 'key' => 'advertisment', 'title' => 'Advertisement categories', 'has_icons' => true, 'icons_for_only_roots' => true, 'icons_type' => 'select2', 'icons_presenter_class' => \App\Icons\ClassifiedIconsPresenter::class, 'levels' => 3, ]); CategoryGroup::create([ 'key' => 'forum', 'title' => 'Forum categories', 'has_icons' => true, 'icons_for_only_roots' => true, 'icons_type' => 'file', 'levels' => null, // no limit ]);
图标集
- 创建图标表示器。它应该实现 \Modules\Category\Icons\IconSetInterface
use Modules\Category\Icons\IconSetInterface; class CustomIconSet implements IconSetInterface { /** * Get array of available icons * * @return array */ public function getIcons(): array { return [ // Class => Text 'my-icon-1' => 'My Icon 1', 'my-icon-2' => 'My Icon 2' ]; } /** * Get template for select2 render * * @return string */ public function getSelect2Template(): string { return '<i class="::class::"></i><span>::text::</span>'; } /** * Get styles to inject * * @return array */ public function getInjectableStyles(): array { return [ '/link/to/your/css/style.css' ]; } /** * Get sprite to inject before container * * @return string */ public function getInjectableSprite(): string { return ''; // this is needed when using SVG icons. ex.: return view('svg/sprite')->render(); } }