diff --git a/best_practices/controllers.rst b/best_practices/controllers.rst index 05cd7a1af9b..5d34928526b 100644 --- a/best_practices/controllers.rst +++ b/best_practices/controllers.rst @@ -206,7 +206,6 @@ Pre and Post Hooks ------------------ If you need to execute some code before or after the execution of your controllers, -you can use the EventDispatcher component to `set up before/after filters`_. +you can use the EventDispatcher component to :doc:`/cookbook/event_dispatcher/before_after_filters`. .. _`ParamConverter`: http://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/converters.html -.. _`set up before/after filters`: http://symfony.com/doc/current/cookbook/event_dispatcher/before_after_filters.html diff --git a/best_practices/creating-the-project.rst b/best_practices/creating-the-project.rst index 244cb6741b4..16402420df4 100644 --- a/best_practices/creating-the-project.rst +++ b/best_practices/creating-the-project.rst @@ -220,7 +220,8 @@ Extending the Directory Structure --------------------------------- If your project or infrastructure requires some changes to the default directory -structure of Symfony, you can `override the location of the main directories`_: +structure of Symfony, you can +:doc:`override the location of the main directories `: ``cache/``, ``logs/`` and ``web/``. In addition, Symfony3 will use a slightly different directory structure when @@ -247,6 +248,5 @@ the Symfony2 directory structure. .. _`Composer`: https://getcomposer.org/ .. _`Get Started`: https://getcomposer.org/doc/00-intro.md .. _`Composer download page`: https://getcomposer.org/download/ -.. _`override the location of the main directories`: http://symfony.com/doc/current/cookbook/configuration/override_dir_structure.html .. _`public checksums repository`: https://github.com/sensiolabs/checksums .. _`these steps`: http://fabien.potencier.org/article/73/signing-project-releases diff --git a/best_practices/forms.rst b/best_practices/forms.rst index 883f2c8a998..e8a7192fc82 100644 --- a/best_practices/forms.rst +++ b/best_practices/forms.rst @@ -69,9 +69,11 @@ To use the class, use ``createForm`` and instantiate the new class: Registering Forms as Services ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -You can also `register your form type as a service`_. But this is *not* recommended -unless you plan to reuse the new form type in many places or embed it in -other forms directly or via the `collection type`_. +You can also +:ref:`register your form type as a service `. +But this is *not* recommended unless you plan to reuse the new form type in many +places or embed it in other forms directly or via the +:doc:`collection type `. For most forms that are used only to edit or create something, registering the form as a service is over-kill, and makes it more difficult to figure @@ -169,7 +171,7 @@ fields: If you need more control over how your fields are rendered, then you should remove the ``form_widget(form)`` function and render your fields individually. -See `How to Customize Form Rendering`_ for more information on this and how +See :doc:`/cookbook/form/form_customization` for more information on this and how you can control *how* the form renders at a global level using form theming. Handling Form Submits @@ -210,8 +212,3 @@ Second, we recommend using ``$form->isSubmitted()`` in the ``if`` statement for clarity. This isn't technically needed, since ``isValid()`` first calls ``isSubmitted()``. But without this, the flow doesn't read well as it *looks* like the form is *always* processed (even on the GET request). - -.. _`register your form type as a service`: http://symfony.com/doc/current/cookbook/form/create_custom_field_type.html#creating-your-field-type-as-a-service -.. _`collection type`: http://symfony.com/doc/current/reference/forms/types/collection.html -.. _`How to Customize Form Rendering`: http://symfony.com/doc/current/cookbook/form/form_customization.html -.. _`form event system`: http://symfony.com/doc/current/cookbook/form/dynamic_form_modification.html diff --git a/best_practices/introduction.rst b/best_practices/introduction.rst index 6a83cd2ae6b..d1d0e760d32 100644 --- a/best_practices/introduction.rst +++ b/best_practices/introduction.rst @@ -59,7 +59,7 @@ Who this Book Is for (Hint: It's not a Tutorial) Any Symfony developer, whether you are an expert or a newcomer, can read this guide. But since this isn't a tutorial, you'll need some basic knowledge of Symfony to follow everything. If you are totally new to Symfony, welcome! -Start with `The Quick Tour`_ tutorial first. +Start with :doc:`The Quick Tour ` tutorial first. We've deliberately kept this guide short. We won't repeat explanations that you can find in the vast Symfony documentation, like discussions about dependency @@ -95,7 +95,3 @@ practices**. The reasons for not doing it are various: your tests or adding features that provide real value to the end users. .. _`Fabien Potencier`: https://connect.sensiolabs.com/profile/fabpot -.. _`The Quick Tour`: http://symfony.com/doc/current/quick_tour/the_big_picture.html -.. _`The Official Symfony Book`: http://symfony.com/doc/current/book/index.html -.. _`The Symfony Cookbook`: http://symfony.com/doc/current/cookbook/index.html -.. _`github.com/.../...`: http://github.com/.../... diff --git a/best_practices/security.rst b/best_practices/security.rst index 026c672bcaa..4c18acc878b 100644 --- a/best_practices/security.rst +++ b/best_practices/security.rst @@ -6,7 +6,8 @@ Authentication and Firewalls (i.e. Getting the User's Credentials) You can configure Symfony to authenticate your users using any method you want and to load user information from any source. This is a complex topic, -but the `Security Cookbook Section`_ has a lot of information about this. +but the :doc:`Security Cookbook Section ` has a +lot of information about this. Regardless of your needs, authentication is configured in ``security.yml``, primarily under the ``firewalls`` key. @@ -72,8 +73,9 @@ Authorization (i.e. Denying Access) ----------------------------------- Symfony gives you several ways to enforce authorization, including the ``access_control`` -configuration in `security.yml`_, the :ref:`@Security annotation ` -and using :ref:`isGranted ` on the ``security.context`` +configuration in :doc:`security.yml ` the +:ref:`@Security annotation ` and using +:ref:`isGranted ` on the ``security.context`` service directly. .. best-practice:: @@ -240,8 +242,8 @@ Security Voters If your security logic is complex and can't be centralized into a method like ``isAuthor()``, you should leverage custom voters. These are an order -of magnitude easier than `ACL's`_ and will give you the flexibility you need -in almost all cases. +of magnitude easier than :doc:`ACL's ` and will give +you the flexibility you need in almost all cases. First, create a voter class. The following example shows a voter that implements the same ``getAuthorEmail`` logic you used above: @@ -337,27 +339,18 @@ The `FOSUserBundle`_, developed by the Symfony community, adds support for a database-backed user system in Symfony2. It also handles common tasks like user registration and forgotten password functionality. -Enable the `Remember Me feature`_ to allow your users to stay logged in for -a long period of time. +Enable the :doc:`Remember Me feature ` to +allow your users to stay logged in for a long period of time. When providing customer support, sometimes it's necessary to access the application as some *other* user so that you can reproduce the problem. Symfony provides -the ability to `impersonate users`_. +the ability to :doc:`impersonate users `. If your company uses a user login method not supported by Symfony, you can -develop `your own user provider`_ and `your own authentication provider`_. +develop :doc:`your own user provider ` and +:doc:`your own authentication provider `. -.. _`Security Cookbook Section`: http://symfony.com/doc/current/cookbook/security/index.html -.. _`security.yml`: http://symfony.com/doc/current/reference/configuration/security.html .. _`ParamConverter`: http://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/converters.html .. _`@Security annotation`: http://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/security.html -.. _`security.yml`: http://symfony.com/doc/current/reference/configuration/security.html -.. _`security voter`: http://symfony.com/doc/current/cookbook/security/voters_data_permission.html -.. _`Acces Control List`: http://symfony.com/doc/current/cookbook/security/acl.html -.. _`ACL's`: http://symfony.com/doc/current/cookbook/security/acl.html .. _`expression`: http://symfony.com/doc/current/components/expression_language/introduction.html .. _`FOSUserBundle`: https://github.com/FriendsOfSymfony/FOSUserBundle -.. _`Remember Me feature`: http://symfony.com/doc/current/cookbook/security/remember_me.html -.. _`impersonate users`: http://symfony.com/doc/current/cookbook/security/impersonating_user.html -.. _`your own user provider`: http://symfony.com/doc/current/cookbook/security/custom_provider.html -.. _`your own authentication provider`: http://symfony.com/doc/current/cookbook/security/custom_authentication_provider.html diff --git a/best_practices/templates.rst b/best_practices/templates.rst index 0b6936ba3ef..01a4b80e80b 100644 --- a/best_practices/templates.rst +++ b/best_practices/templates.rst @@ -156,9 +156,5 @@ name is irrelevant because you never use it in your own code): tags: - { name: twig.extension } - .. _`Twig`: http://twig.sensiolabs.org/ .. _`Parsedown`: http://parsedown.org/ -.. _`Twig global variables`: http://symfony.com/doc/master/cookbook/templating/global_variables.html -.. _`override error pages`: http://symfony.com/doc/current/cookbook/controller/error_pages.html -.. _`render a template without using a controller`: http://symfony.com/doc/current/cookbook/templating/render_without_controller.html diff --git a/best_practices/web-assets.rst b/best_practices/web-assets.rst index 862e60987a5..a45d85542b5 100644 --- a/best_practices/web-assets.rst +++ b/best_practices/web-assets.rst @@ -49,8 +49,9 @@ tools like GruntJS. Use Assetic to compile, combine and minimize web assets, unless you're comfortable with frontend tools like GruntJS. -`Assetic`_ is an asset manager capable of compiling assets developed with -a lot of different frontend technologies like LESS, Sass and CoffeeScript. +:doc:`Assetic ` is an asset manager capable +of compiling assets developed with a lot of different frontend technologies +like LESS, Sass and CoffeeScript. Combining all your assets with Assetic is a matter of wrapping all the assets with a single Twig tag: @@ -86,12 +87,11 @@ separating the repositories if you want). Learn More about Assetic ------------------------ -Assetic can also minimize CSS and JavaScript assets `using UglifyCSS/UglifyJS`_ -to speed up your websites. You can even `compress images`_ with Assetic to -reduce their size before serving them to the user. Check out the -`official Assetic documentation`_ to learn more about all the available features. +Assetic can also minimize CSS and JavaScript assets +:doc:`using UglifyCSS/UglifyJS ` to speed up your +websites. You can even :doc:`compress images ` +with Assetic to reduce their size before serving them to the user. Check out +the `official Assetic documentation`_ to learn more about all the available +features. -.. _`Assetic`: http://symfony.com/doc/current/cookbook/assetic/asset_management.html -.. _`using UglifyCSS/UglifyJS`: http://symfony.com/doc/current/cookbook/assetic/uglifyjs.html -.. _`compress images`: http://symfony.com/doc/current/cookbook/assetic/jpeg_optimize.html .. _`official Assetic documentation`: https://github.com/kriswallsmith/assetic