Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I suggest creating a DateDisplayerBundle and a PaginatorBundle instead of putting their related code in a more general bundle. There are a few reasons for this:</p> <ul> <li>The role of each bundle is very clear, and you know where your code is.</li> <li>Sharing pieces of functionality (date displayer, paginator) between different projects is simpler when you have separate bundles, versus one general bundle that you then may need to prune.</li> </ul> <p>There's no hard rule saying that bundles must have controllers. Bundles can have any mix of business logic, templates, controllers, and configuration, but there's no restriction on what you can store in them. </p> <p>On the other hand, if your functionality is not very complex, it may not warrant being contained within a bundle at all. In this case you could create a library in <code>/vendor</code> for it. Symfony makes use of a number of libraries in this fashion (see Monolog and Doctrine for example.)</p> <p>As for your second question, I think the reason for keeping layouts in <code>app\Resources\views</code> is because it's a convenient way for you to keep track of all your layouts. When you have a project that has many bundles, you might lose track of where a certain layout is. But if you keep them all within one centralized location, you'll always know exactly where to look. As with many things in Symfony2, this isn't a rule that's set in stone. You could easily store your layouts in a bundle, but I don't think it's the recommended practice.</p> <p>As for your question about your general Root bundle, I would say in most cases you should avoid shoehorning a bunch of different features in one bundle. See my earlier points about keeping your bundles specific. When I started developing with Symfony2, I had some trouble determining what code should go in what bundle. It's not how I was used to thinking about programming. But eventually you start to see how the individual pieces of the puzzle fit, and that makes determining the bundle structure easier. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload