emiliomg / frontpage-bundle
此包已废弃,不再维护。没有建议的替代包。
如果你的项目不需要主页,但404页面又非常丑陋,这是一个简单的解决方案。
1.0.1
2015-12-22 23:02 UTC
Requires
- php: >=5.3
- symfony/framework-bundle: ~2.3|~3.0
This package is not auto-updated.
Last update: 2020-10-06 23:09:36 UTC
README
这个Symfony-Bundle提供了一个易于使用的通用主页。
安装
- 在
composer.json中添加该包
"require": {
"emiliomg/frontpage-bundle": "~1.0"
}
- 在
app/AppKernel.php中注册该包
// app/AppKernel.php
public function registerBundles()
{
return array(
// ...
new EmilioMg\FrontpageBundle\EmilioMgFrontpageBundle(),
);
}
- 在
app/config/routing.yml中导入路由定义
# app/config/routing.yml
emiliomg_frontpage:
resource: "@EmilioMgFrontpageBundle/Resources/config/routing.yml"
prefix: /
- 安装资源
$ bin/console assets:install
- (可选) 在
app/config/config.yml中启用包的配置
# app/config/config.yml
emilio_mg_frontpage: ~
配置
默认文本相当通用。如果你想使用自己的文本(推荐这样做),请覆盖在 app/config/config.yml 中的包配置。
emilio_mg_frontpage:
text: "The text I want to display. Text in #hashtags# will be emphasised."
title: "The Title of the page. If not set, the title will equal the text."