mssimi / content-management-bundle
简单内容管理系统
dev-master / 0.1.x-dev
2018-06-13 10:45 UTC
Requires
- php: >=7.1
- doctrine/doctrine-bundle: ^1.6
- doctrine/doctrine-cache-bundle: ^1.2
- doctrine/orm: ^2.5
- doctrine/phpcr-bundle: ^1.3
- doctrine/phpcr-odm: ^1.4
- egeloen/ckeditor-bundle: ^5.0
- friendsofsymfony/jsrouting-bundle: ^1.6
- incenteev/composer-parameter-handler: ^2.0
- jackalope/jackalope-doctrine-dbal: 1.2.*
- knplabs/knp-menu-bundle: ^2.0
- knplabs/knp-paginator-bundle: ^2.5
- liip/imagine-bundle: ^1.7
- sensio/distribution-bundle: ^5.0
- sensio/framework-extra-bundle: ^3.0.2
- symfony/monolog-bundle: ^3.0.2
- symfony/polyfill-apcu: ^1.0
- symfony/swiftmailer-bundle: ^2.3.10
- symfony/symfony: ^3.0
- twig/twig: ^1.0||^2.0
- vich/uploader-bundle: ^1.5
Requires (Dev)
- phpstan/phpstan: ^0.7.0
- sensio/generator-bundle: ^3.0
- symfony/phpunit-bridge: ^3.0
Suggests
This package is auto-updated.
Last update: 2024-09-29 04:48:46 UTC
README
此捆绑包为symfony项目提供基本内容管理工具。您可以将此捆绑包集成到现有系统中以添加CMS功能,或者用于简单的网站。
捆绑包实现了以下功能
- 区块
- 菜单
- 页面
- 博客/文章
- 幻灯片(幻灯片放映)
捆绑包包含CRUD操作以及基本的行政模板,您可以覆盖它们(https://symfony.com.cn/doc/current/templating/overriding.html)。捆绑包还为您提供简单的“RouterController”用于页面。
安装
打开命令控制台,进入您的项目目录,并执行以下命令以下载此捆绑包的最新稳定版本
$ composer require mssimi/content-management-bundle
捆绑包使用其他几个捆绑包,您必须在AppKernel.php中启用它们
// app/AppKernel.php class AppKernel extends Kernel { public function registerBundles() { $bundles = array( // ... new mssimi\ContentManagementBundle\ContentManagementBundle(), new Doctrine\Bundle\PHPCRBundle\DoctrinePHPCRBundle(), new Knp\Bundle\PaginatorBundle\KnpPaginatorBundle(), new Knp\Bundle\MenuBundle\KnpMenuBundle(), new FOS\JsRoutingBundle\FOSJsRoutingBundle(), new Ivory\CKEditorBundle\IvoryCKEditorBundle(), new Vich\UploaderBundle\VichUploaderBundle(), new Liip\ImagineBundle\LiipImagineBundle(), ); } }
路由 - 将以下行添加到您的app/config/routing.yml。警告!!! routing_page.yml必须放在最后!!!
content_management_admin: resource: "@ContentManagementBundle/Resources/config/routing_admin.yml" prefix: /admin/ _liip_imagine: resource: "@LiipImagineBundle/Resources/config/routing.xml" fos_js_routing: resource: "@FOSJsRoutingBundle/Resources/config/routing/routing.xml" content_management_page: resource: "@ContentManagementBundle/Resources/config/routing_page.yml" prefix: /
配置
content_management: locales: ['en','de','fr'] items_per_page: 10 # item per page for pagination in admin articles_per_page: 20 # articles per page in blog pagination page_template: 'cms/page.html.twig' blog_template: 'cms/blog.html.twig' article_template: 'cms/article.html.twig' doctrine_phpcr: session: backend: type: doctrinedbal logging: true profiling: true workspace: default odm: auto_mapping: true auto_generate_proxy_classes: "%kernel.debug%" locales: en: [] de: [] fr: [] locale_fallback: hardcoded default_locale: en ivory_ck_editor: default_config: default configs: default: contentsCss: ['//maxcdn.bootstrap.ac.cn/bootstrap/3.3.7/css/bootstrap.min.css'] allowedContent: true autoParagraph: false entities: false vich_uploader: db_driver: orm mappings: content_management: uri_prefix: /images/cms upload_destination: '%kernel.root_dir%/../web/images/cms' db_driver: phpcr # filters used in admin, feel free to change config to fit your needs liip_imagine: resolvers: default: web_path: ~ filter_sets: cache: ~ thumbnail: quality: 75 filters: strip: ~ thumbnail: { size: [50, 50], mode: inset } slider: quality: 75 filters: strip: ~ thumbnail: { size: [1140, 560], mode: outbound }
有关更多信息,请查看以下链接
- https://symfony.com.cn/doc/master/cmf/bundles/phpcr_odm/introduction.html
- https://github.com/egeloen/IvoryCKEditorBundle
- https://github.com/dustin10/VichUploaderBundle
- https://github.com/liip/LiipImagineBundle
如果您想支持将图像上传到ckeditor,则强烈推荐此捆绑包。
启用缓存也强烈推荐
安装资源
$ php bin/console asset:install
初始化数据库
$ php bin/console doctrine:phpcr:init:dbal $ php bin/console doctrine:phpcr:repository:init
如果以具有ROLE_CMS角色的用户登录,所有区块、菜单、滑块将显示快速编辑按钮。将此CSS文件添加到您的front base.html.twig,或提供您自己的编辑框CSS。
<link rel="stylesheet" href="{{ asset('bundles/contentmanagement/css/edit.css') }}">