cedriclombardot/admingenerator-user-bundle

Symfony2Admingenerator 的 FOSUserBundle 集成。

v1.1.1 2014-06-18 11:15 UTC

This package is auto-updated.

Last update: 2024-09-24 04:01:38 UTC


README

KnpBundles Badge project status Latest Stable Version Total Downloads

此包是 Symfony2 Admin Generator 的一部分,基于 YAML 配置和 Twig 模板。

它将允许您将 FOSUserBundle 配置为在 config.yml 中配置的基本布局。

关注我们的 Twitter!

不要错过来自 Symfony2 Admin Generator 的任何更新!今天加入 Twitter 并 关注我们

如何设置

通过 composer 安装

返回目录

1. 下载文件

将 Admingenerator 添加到您的 composer.json

v1.0 分支用于 Twitter Bootstrap2 样式

"require": {
    "cedriclombardot/admingenerator-user-bundle": "~1.0"
},

v1.1 分支用于 Twitter Bootstrap3 样式

"require": {
    "cedriclombardot/admingenerator-user-bundle": "~1.1"
},

然后运行 php composer.phar update 命令。

注意:分支反映了 AdmingeneratorGeneratorBundle 的分支。

设置 FOSUserBundle

遵循捆绑文档: https://github.com/FriendsOfSymfony/FOSUserBundle/blob/master/Resources/doc/index.md

在 AppKernel 中启用捆绑

 $bundles = array(
    // ....
    new Admingenerator\UserBundle\AdmingeneratorUserBundle(),

配置用于登录表单的基本布局

在 config.yml 中

admingenerator_user:
     login_template: AdmingeneratorGeneratorBundle::base_admin.html.twig

在项目中使用 twig 扩展

{% extends_my_configured_layout 'admingenerator.user_login_template' %}

将与以下相同

{% extends 'The value of the container paramater admingenerator.user_login_template' %}