You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -103,7 +103,7 @@ will be executed and the ``$slug`` variable will be equal to ``my-post``.
103
103
104
104
This is the goal of the Symfony2 router: to map the URL of a request to a
105
105
controller. Along the way, you'll learn all sorts of tricks that make mapping
106
-
even the most complex URLs easy.
106
+
even the most complex URLs easy.
107
107
108
108
.. index::
109
109
single: Routing; Under the hood
@@ -821,7 +821,7 @@ The controller might look like this:
821
821
namespace Acme\BlogBundle\Controller;
822
822
823
823
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
824
-
824
+
825
825
class BlogController extends Controller
826
826
{
827
827
public function showAction($slug)
@@ -1015,6 +1015,11 @@ instead of simply ``/hello/{name}``:
1015
1015
The string ``/admin`` will now be prepended to the pattern of each route
1016
1016
loaded from the new routing resource.
1017
1017
1018
+
.. tip::
1019
+
1020
+
You can also define routes using annotations. See the :doc:`FrameworkExtraBundle documentation<bundles/SensioFrameworkExtraBundle/annotations/routing>`
1021
+
to see how to.
1022
+
1018
1023
.. index::
1019
1024
single: Routing; Debugging
1020
1025
@@ -1091,9 +1096,9 @@ In an upcoming section, you'll learn how to generate URLs from inside templates.
1091
1096
If the frontend of your application uses AJAX requests, you might want
1092
1097
to be able to generate URLs in JavaScript based on your routing configuration.
1093
1098
By using the `FOSJsRoutingBundle`_, you can do exactly that:
1094
-
1099
+
1095
1100
.. code-block:: javascript
1096
-
1101
+
1097
1102
var url =Routing.generate('blog_show', { "slug":'my-blog-post'});
1098
1103
1099
1104
For more information, see the documentation for that bundle.
@@ -1120,9 +1125,9 @@ method:
1120
1125
on server information supplied by PHP. When generating absolute URLs for
1121
1126
scripts run from the command line, you'll need to manually set the desired
0 commit comments