wearejust / sonata-theme-bundle
此包已被弃用且不再维护。未建议替代包。
自定义SonataAdminBundle主题
3.0
2019-10-09 11:24 UTC
Requires
- pixassociates/sortable-behavior-bundle: ^1.4
- sonata-project/admin-bundle: ^3.1
- symfony/framework-bundle: ^3.3|~4.0
- 3.x-dev
- 3.0
- 2.x-dev
- dev-master / 2.x-dev
- 2.1.15
- 2.1.14
- 2.1.13
- 2.1.12
- 2.1.11
- 2.1.10
- 2.1.9
- 2.1.8
- 2.1.7
- 2.1.6
- 2.1.5
- 2.1.4
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1
- 2.0
- 1.x-dev
- 1.3
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2
- 1.1
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0
- dev-dependabot/npm_and_yarn/qs-6.4.1
- dev-dependabot/npm_and_yarn/loader-utils-1.4.2
- dev-dependabot/npm_and_yarn/async-2.6.4
- dev-dependabot/npm_and_yarn/node-sass-7.0.0
- dev-dependabot/npm_and_yarn/tar-2.2.2
- dev-dependabot/npm_and_yarn/hosted-git-info-2.8.9
- dev-dependabot/npm_and_yarn/y18n-3.2.2
- dev-dependabot/npm_and_yarn/elliptic-6.5.4
- dev-dependabot/npm_and_yarn/ini-1.3.7
- dev-dependabot/npm_and_yarn/lodash.mergewith-4.6.2
- dev-dependabot/npm_and_yarn/jquery-3.5.0
- dev-dependabot/npm_and_yarn/stringstream-0.0.6
- dev-feature/html_css_overhaul
- dev-feature/new_cms_layout
- dev-feature/sticky_add_button
- dev-feature/table_checkbox
- dev-feature/removes_progress_bar
- dev-feature/overview_button_group_styling
This package is auto-updated.
Last update: 2023-03-19 22:20:13 UTC
README
Sonata Theme Bundle
安装
提示:来自1.x版本?请查看我们的升级指南
步骤 1:下载包
打开命令行,进入项目目录,并执行以下命令以下载此包的最新稳定版本
$ composer require wearejust/sonata-theme-bundle "^2"
此命令要求您全局安装了Composer,如Composer文档的安装章节中所述。
步骤 2:启用包
然后,通过将其添加到项目app/AppKernel.php
文件中注册的包列表来启用该包
<?php // app/AppKernel.php // ... class AppKernel extends Kernel { public function registerBundles() { $bundles = array( // ... new Wearejust\SonataThemeBundle\WearejustSonataThemeBundle(), ); // ... } // ... }
另外,通过遵循其安装指南启用pixSortableBehaviorBundle。
另外,在您的routing.yml
中添加路由
// routing.yml _wearejust_sonata_theme: resource: "@WearejustSonataThemeBundle/Resources/config/routing.yml"
步骤 3:编译资源文件
此包中的资源尚未构建。这意味着您需要自行构建资源(需要Yarn才能使用)。已经为您配置好了webpack,锁定,加载并准备好使用。将以下配置添加到您的自己的package.json
文件中。
{ "scripts": { "build-cms": "cd ./vendor/wearejust/sonata-theme-bundle && yarn && yarn run build", } }
现在您可以运行yarn run build-cms
,资源将被发布到公共目录,并由Symfony框架自动创建符号链接。
另外,在您的config.yml
中添加以下内容。
framework: assets: packages: backend: json_manifest_path: '%kernel.root_dir%/../public/bundles/wearejustsonatatheme/build/manifest.json'
步骤 4:添加额外配置(可选)
您可以覆盖我们提供的配置,可以指定自定义的yml文件(如Resources/config/theme.yml),方法如下
wearejust_sonata_theme: custom_theme: /path/to/custom/yml
同样,也可以覆盖我们的配置,并在您的yml中指定额外的extra_css
或extra_js
键。
# example.yml extra_css: - /path/to/extra/css.css extra_js: - /path/to/extra/js.js