emiliomg / frontpage-bundle

此包已废弃,不再维护。没有建议的替代包。

如果你的项目不需要主页,但404页面又非常丑陋,这是一个简单的解决方案。

安装: 18

依赖: 0

建议者: 0

安全: 0

星标: 0

关注者: 0

分支: 0

开放问题: 0

类型:symfony-bundle

1.0.1 2015-12-22 23:02 UTC

This package is not auto-updated.

Last update: 2020-10-06 23:09:36 UTC


README

这个Symfony-Bundle提供了一个易于使用的通用主页。

安装

  1. composer.json 中添加该包
"require": {
    "emiliomg/frontpage-bundle": "~1.0"
}
  1. app/AppKernel.php 中注册该包
// app/AppKernel.php
public function registerBundles()
{
    return array(
        // ...
        new EmilioMg\FrontpageBundle\EmilioMgFrontpageBundle(),
    );
}
  1. app/config/routing.yml 中导入路由定义
# app/config/routing.yml
emiliomg_frontpage:
    resource: "@EmilioMgFrontpageBundle/Resources/config/routing.yml"
    prefix:   /
  1. 安装资源
	$ bin/console assets:install
  1. (可选) 在 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."