How do I get a list of bundles in symfony2/symfony3?

前端 未结 5 912
被撕碎了的回忆
被撕碎了的回忆 2021-02-02 12:14

I\'ve just started using symfony and I\'d like to get a list of bundles from a particular vendor, iterate through them and call a $bundle->renderSomething() function on each def

5条回答
  •  情深已故
    2021-02-02 12:48

    The easiest way to do it in console and that outputs bundle names correctly is:

    Symfony 2

    php app/console config:dump-reference
    

    Symfony 3

    php bin/console config:dump-reference
    

    The key here is not to provide any options or arguments. In this case, the command simply outputs all available bundles:

    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              |                                   |
    +------------------------------------+-----------------------------------+
    

提交回复
热议问题