如何获取 symfony/symfony 3 中的捆绑包列表?

2023-12-24

我刚刚开始使用 symfony,我想从特定供应商获取捆绑包列表,迭代它们并在每个默认控制器上调用 $bundle->renderSomething() 函数。

首先,我需要获取要迭代的包列表,或迭代每个对象。关于最好的方法有什么想法吗?


在控制台中执行此操作并正确输出包名称的最简单方法是:

交响乐2

php app/console config:dump-reference

交响乐3

php bin/console config:dump-reference

这里的关键是不要提供任何选项或参数。在这种情况下,该命令只是输出所有可用的包:

Available registered bundles with their extension alias if available:
+------------------------------------+-----------------------------------+
| Bundle name                        | Extension alias                   |
+------------------------------------+-----------------------------------+
| FrameworkBundle                    | framework                         |
| SecurityBundle                     | security                          |
| TwigBundle                         | twig                              |
| MonologBundle                      | monolog                           |
| SwiftmailerBundle                  | swiftmailer                       |
| DoctrineBundle                     | doctrine                          |
| AsseticBundle                      | assetic                           |
| GearmanBundle                      | gearman                           |
| SMMemcacheBundle                   | sm_memcache                       |
| PrestaSitemapBundle                | presta_sitemap                    |
| DoctrineCacheBundle                | doctrine_cache                    |
| CybernoxAmazonWebServicesBundle    | cybernox_amazon_web_services      |
| FOSFacebookBundle                  | fos_facebook                      |
| HWIOAuthBundle                     | hwi_oauth                         |
| FkrSimplePieBundle                 | fkr_simple_pie                    |
| RMSPushNotificationsBundle         | rms_push_notifications            |
| RobertoTruToInlineStyleEmailBundle | roberto_tru_to_inline_style_email |
| InsomniaMaxMindGeoIpBundle         | insomnia_max_mind_geo_ip          |
| EWZRecaptchaBundle                 | ewz_recaptcha                     |
| MopaBootstrapBundle                | mopa_bootstrap                    |
| JanThomas89MailSafeBundle          | jan_thomas89_mail_safe            |
| WebProfilerBundle                  | web_profiler                      |
| SensioDistributionBundle           | sensio_distribution               |
| SensioGeneratorBundle              |                                   |
+------------------------------------+-----------------------------------+
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何获取 symfony/symfony 3 中的捆绑包列表? 的相关文章

随机推荐