如何从symfony2 admin-generator生成管理员

时间:2012-05-19 11:10:38

标签: symfony

我是symfony2的新手,我在symfony中使用doctrine orm创建了一个简单的实体模型,但我不知道如何生成和使用admin-generator,我实际上尝试并安装了此管理生成器所需的所有包http://symfony2admingenerator.org/。甚至尝试使用

设置它
php app/console admin:setup

一切都很顺利,但我不知道如何查看管理员是否生成它。

我的generator.yml

generator: admingenerator.generator.doctrine
params:  
  model: Go\UserBundle\Entity\User
  namespace_prefix: Go
  bundle_name: UserBundle
  fields: 
    firstname:
      help: If you want to see this content on you website
    lastname:
      help: If you want to see this content on you website

builders:
  list:
    params:
      firstname: Here is a beautiful title no  ???
      display: [ id, firstname, firstname, email ]
      max_per_page: 3
      actions:
        new: ~ 
      object_actions:
        edit: ~ 
        delete: ~
  filters: 
    params:
      fields:
        release_date:
          formType: date_range
      display: [ id, firstname, firstname, email ]

  new: 
    params:
      title: You're creating a new movie
      display: [ firstname, firstname, email  ]
      actions:
        list: ~
  edit: 
    params:
      title: You're editing the movie ""
      display: 
        "NONE": [ email ]
        "Other informations": [  ]
      actions:
        list: ~
  delete: ~

我的实体类位于

src\Go\UserBundle\Entity\User.php
src\Go\UserBundle\Entity\UserRepository.php

我的管理包位于

Go\GoAdminBundle\Controller\Admin\DeleteController.php
Go\GoAdminBundle\Controller\Admin\EditController.php
Go\GoAdminBundle\Controller\Admin\ListController.php
Go\GoAdminBundle\Controller\Admin\NewController.php

1 个答案:

答案 0 :(得分:2)

我现在能够访问我刚刚由routing.yml配置的管理员

GoGoAdminBundle_admin_go_go_admin_bundle_admin:
    resource: "@GoGoAdminBundle/Controller/Admin/"
    type: admingenerator
    prefix: /admin