indigophp / sonata-admin-print-bundle
此包已弃用且不再维护。未建议替代包。
允许打印实体
v0.1.0
2017-01-20 18:32 UTC
Requires
- php: >=5.4
- sonata-project/admin-bundle: ^2.0 || ^3.0
This package is auto-updated.
Last update: 2021-11-24 09:10:38 UTC
README
允许打印实体。
安装
通过 Composer
$ composer require indigophp/sonata-admin-print-bundle
使用方法
首先,您需要熟悉创建自定义操作的过程。请参阅这里的说明。
- 在您的自定义管理类中使用
Indigo\SonataAdminPrintBundle\Admin\PrintAdmin
trait。 - 在您的自定义管理控制器中使用
Indigo\SonataAdminPrintBundle\Controller\CRUDPrintController
trait。确保在服务定义中传递控制器名称作为参数。(请参阅上面的链接了解如何操作) - 在
configureListFields
方法中配置一个名为print
的操作。您需要手动设置模板为SonataAdminPrintBundle::list__action_print.html.twig
,如下所示
->add('_action', 'actions', array( 'actions' => array( 'show' => array(), 'edit' => array(), 'delete' => array(), 'print' => array( 'template' => 'SonataAdminPrintBundle::list__action_print.html.twig', ), ) ))
测试
$ composer test
贡献
有关详细信息,请参阅 CONTRIBUTING。
安全
如果您发现任何与安全相关的问题,请通过 security@indigophp.com 联系我们。
致谢
许可
MIT 许可证(MIT)。请参阅 许可文件 了解更多信息。