Does the bundle name always contain vendor name?

Source: Internet
Author: User
In Symfony3When performing php bin/console generate:bundleWhen the bundle is created, the console asks if it will share the bundle that will be created in the future.

If selected no , the bundle is created after the catalog as src/UserBundle , if selected yes , you need to add vendor name, after creating assrc/XX/UserBundle

However, there may not be a shared plan during creation, so if you have plans to share later, you will need to reorganize the files namespace and the corresponding profiles.

Should you always include vendor name when the bundle is created?

Like src/XX/UserBundle or src/XX/Bundle/UserBundle

The side effect is that when you are not ready to share the current bundle, you have one more in the application source code namespace . or service the definition and route when a prefix is more, such asxx_user.user_manager

This frees you from worrying about the need to change the directory structure, namespace, and namespace issues for route and service when sharing the current bundle later.

Do you have any idea?

Reply content:

When Symfony3 executing the php bin/console generate:bundle create bundle, the console will ask if it will share the bundle that will be created in the future.

If selected no , the bundle is created after the catalog as src/UserBundle , if selected yes , you need to add vendor name, after creating assrc/XX/UserBundle

However, there may not be a shared plan during creation, so if you have plans to share later, you will need to reorganize the files namespace and the corresponding profiles.

Should you always include vendor name when the bundle is created?

Like src/XX/UserBundle or src/XX/Bundle/UserBundle

The side effect is that when you are not ready to share the current bundle, you have one more in the application source code namespace . or service the definition and route when a prefix is more, such asxx_user.user_manager

This frees you from worrying about the need to change the directory structure, namespace, and namespace issues for route and service when sharing the current bundle later.

Do you have any idea?

Why are you vendorname?

VendorName is to avoid different Vendor of the same bundlename conflict, simply to avoid naming conflicts, such as Foo and Bar two Vendor to create a userbundle, then can not add vendorname will produce Is it not difficult to understand the conflict?

Under what circumstances should VendorName be included?

If your bundle is used only in the current project, not as a shared third-party bundle (which typically needs to be published as a composer package), then you don't need to vendorname, but you need to add vendername instead.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.