crl/admin-bundle

从 Doctrine ORM 实体自动生成的 Django 风格管理界面

安装: 6

依赖者: 0

建议者: 0

安全: 0

星标: 2

关注者: 2

分支: 0

开放问题: 0

类型:symfony-bundle

dev-master 2013-05-16 22:32 UTC

This package is not auto-updated.

Last update: 2024-09-24 03:23:22 UTC


README

安装 admin 包

使用 Composer

admin 包应通过 composer 作为包安装。如果您尝试这样做,我将非常感激您的反馈。Composer 在我开发托管的服务器上无法运行。运行时间过长,任务在完成前就被终止了。

手动添加

作为 composer 的替代方案,请按照以下步骤操作

1) Place the CRL/AdminBundle directory with CRL rooted either in /Symfony/src or in /Symfony/vendor/bundles.  From the CRL directory, checkout into this directory by doing:

git clone https://github.com/charlar/symfony-admin.git/ AdminBundle

2) In Symfony/web/AppKernal.php, in register bundles add:

   new CRL\AdminBundle\CRLAdminBundle(),

 (depending on the version of symfony, you may have to manually edit the Autoloads file.

3) In routing.yml (or routing_dev.yml) add:
_admin:
	resource: "@CRLAdminBundle/Controller/AdminController.php"
	type:     annotation
	prefix:   /admin

使用 admin 包

1) Navigate to /admin, you will get a list of Entities.
2) each data object will have a link to view structure, browse data and add.
3) if you browse data, you will get a list of data objects. the objects will be listed by id, or by the data returned from __toString(), if it is implemented on the Entity
4) clicking on the entity will allow you to edit it.
5) from the data object main page, clicking add, will allow you to create a new object

配置

不需要配置。但是,您可以添加配置来为您的实体创建浏览布局。还有一个名为 hash 的开关,可以使用哈希而不是十六进制编码的字符串来创建您实体的更短的 URL。这些配置目前尚未使用。

已知问题

1) If not all fields of your entity have a get function, Symfony will crash when you try to edit that entity.  (Fix added, but now crashes 2.0 symfony)
2) If you have a entity with a one-to-one or one-to-many relationship and the target entity does not have a __toString() function defined, Symfony will crash when you try to edit the primary entity.

错误

这是一个概念验证,当然充满了错误。欢迎贡献。我希望这个版本得到了良好开发,成为了标准的 Symfony 分发的一部分,就像 Django 内置的管理包一样。