koala / content-bundle
使用 Mercury Editor 的简单 Symfony 2 CMS 包
Requires
- php: >=5.3.3
- friendsofsymfony/jsrouting-bundle: dev-master
- knplabs/knp-menu: >=1.0
- knplabs/knp-menu-bundle: 1.1.*
- stof/doctrine-extensions-bundle: >=1.0
- symfony-cmf/routing-extra-bundle: dev-master
- symfony/framework-bundle: 2.1.*
Requires (Dev)
- doctrine/doctrine-bundle: 1.0.*
- doctrine/orm: >=2.2,<2.4-dev
- symfony/browser-kit: 2.1.*
- symfony/class-loader: 2.1.*
- symfony/css-selector: 2.1.*
- symfony/finder: 2.1.*
- symfony/form: 2.1.*
- symfony/twig-bundle: 2.1.*
- symfony/validator: 2.1.*
- symfony/yaml: 2.1.*
This package is not auto-updated.
Last update: 2020-01-24 14:52:24 UTC
README
KoalaContentBundle 是一个使用惊人的 Mercury Editor 作为前端编辑器的简单 CMS,专为 Symfony 2 框架构建。
使用 composer 安装(Symfony 2.1)
将 koala/content-bundle 添加到 composer.json。
"require": {
...
"koala/content-bundle": "dev-master"
}
然后运行 composer update
安装 KoalaContentBundle 及其所有依赖。Composer 将自动注册新的命名空间。
配置
在您的 app/AppKernel.php
文件中注册新包
public function registerBundles()
{
$bundles = array(
...
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
new Knp\Bundle\MenuBundle\KnpMenuBundle(),
new Symfony\Cmf\Bundle\RoutingExtraBundle\SymfonyCmfRoutingExtraBundle(),
new Koala\ContentBundle\KoalaContentBundle(),
);
return $bundles;
}
在您的 app/config/config.yml
文件中启用 Doctrine Tree 扩展和 Symfony CMF 路由
stof_doctrine_extensions:
orm:
default:
tree: true
symfony_cmf_routing_extra:
chain:
routers_by_id:
koala_content.dynamic_router: 200
router.default: 100
安装资源
php app/console assets:install --symlink web
在 web/mercury
下安装 Mercury 文件。建议使用最新版本,目前为 0.8。(参见 Mercury 下载)
从 https://github.com/downloads/jejacks0n/mercury/mercury-v0.8.0.zip 下载并解压到 web/mercury
。
下一步是为包工作设置所需的路由。将以下内容添加到您的 app/config/routing.yml
koala_content:
resource: @KoalaContentBundle/Resources/config/routing.yml
prefix: /
_注意:默认情况下,Symfony 在 app/config/routing_dev.yml
中有一个欢迎路由,如果您想使用根路由,则需要删除它。
如果您想将内容页面放在单独的分区中,可以将前缀更改为类似 /cms
的内容
最后一步是更新数据库模式并加载一些默认内容。在运行设置命令之前,请确保您已设置数据库配置在 app/config/parameters.yml
中
php app/console koala_content:setup
现在打开您的浏览器开始编辑!