Skip to content

Commit

Permalink
Merge branch '2.5'
Browse files Browse the repository at this point in the history
* 2.5:
  Some fixes thanks to @stof
  Clarifying that the bundles best practices entry is for reusable bundles, not for app bundles
  routing example fixed with routing.xml file
  [Cookbook][Doctrine] Fix typo in XML configuration for custom SQL function
  Fixed broken external link to DemoController Test
  • Loading branch information
weaverryan committed Oct 6, 2014
2 parents b6286fd + 6c6aecf commit 6405a21
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion book/http_fundamentals.rst
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ by adding an entry for ``/contact`` to your routing configuration file:
.. code-block:: xml
<!-- app/config/config.xml -->
<!-- app/config/routing.xml -->
<?xml version="1.0" encoding="UTF-8" ?>
<routes xmlns="http://symfony.com/schema/routing"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Expand Down
2 changes: 1 addition & 1 deletion book/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,6 @@ Learn more
* :doc:`/cookbook/testing/profiling`
* :doc:`/cookbook/testing/bootstrap`

.. _`DemoControllerTest`: https://github.com/symfony/symfony-standard/blob/master/src/Acme/DemoBundle/Tests/Controller/DemoControllerTest.php
.. _`DemoControllerTest`: https://github.com/sensiolabs/SensioDistributionBundle/blob/master/Resources/skeleton/acme-demo-bundle/Acme/DemoBundle/Tests/Controller/DemoControllerTest.php
.. _`$_SERVER`: http://php.net/manual/en/reserved.variables.server.php
.. _`documentation`: http://phpunit.de/manual/current/en/
17 changes: 12 additions & 5 deletions cookbook/bundles/best_practices.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
.. index::
single: Bundle; Best practices

How to Use best Practices for Structuring Bundles
=================================================
Best Practices for Reusable Bundles
===================================

A bundle is a directory that has a well-defined structure and can host anything
from classes to controllers and web resources. Even if bundles are very
flexible, you should follow some best practices if you want to distribute them.
There are 2 types of bundles:

* Application-specific bundles: only used to build your application;
* Reusable bundles: meant to be shared across many projects.

This article is all about how to structure your **reusable bundles** so that
they're easy to configure and extend. Many of these recommendations do not
apply to application bundles because you'll want to keep those as simple
as possible. For application bundles, just follow the practices shown throughout
the book and cookbook.

.. index::
pair: Bundle; Naming conventions
Expand Down
8 changes: 4 additions & 4 deletions cookbook/doctrine/custom_dql_functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ In Symfony, you can register your custom DQL functions as follows:
<doctrine:orm>
<!-- ... -->
<doctrine:dql>
<doctrine:string-function name="test_string>Acme\HelloBundle\DQL\StringFunction</doctrine:string-function>
<doctrine:string-function name="second_string>Acme\HelloBundle\DQL\SecondStringFunction</doctrine:string-function>
<doctrine:numeric-function name="test_numeric>Acme\HelloBundle\DQL\NumericFunction</doctrine:numeric-function>
<doctrine:datetime-function name="test_datetime>Acme\HelloBundle\DQL\DatetimeFunction</doctrine:datetime-function>
<doctrine:string-function name="test_string">Acme\HelloBundle\DQL\StringFunction</doctrine:string-function>
<doctrine:string-function name="second_string">Acme\HelloBundle\DQL\SecondStringFunction</doctrine:string-function>
<doctrine:numeric-function name="test_numeric">Acme\HelloBundle\DQL\NumericFunction</doctrine:numeric-function>
<doctrine:datetime-function name="test_datetime">Acme\HelloBundle\DQL\DatetimeFunction</doctrine:datetime-function>
</doctrine:dql>
</doctrine:orm>
</doctrine:config>
Expand Down

0 comments on commit 6405a21

Please sign in to comment.