Skip to content

Commit 1018da8

Browse files
committed
Merge branch '2.4' into 2.5
* 2.4: Update Collection.rst Fixed code highlighting Added a note about the lacking features of Yaml Component replace "Symfony2" with "Symfony" fix name of the Yaml component Moved 'contributing' images to their own directory add link to form testing chapter in test section Conflicts: components/class_loader/introduction.rst quick_tour/the_big_picture.rst
2 parents 8f01195 + 3a77561 commit 1018da8

File tree

118 files changed

+750
-698
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+750
-698
lines changed

book/controller.rst

+18-18
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ Controller
55
==========
66

77
A controller is a PHP function you create that takes information from the
8-
HTTP request and constructs and returns an HTTP response (as a Symfony2
8+
HTTP request and constructs and returns an HTTP response (as a Symfony
99
``Response`` object). The response could be an HTML page, an XML document,
1010
a serialized JSON array, an image, a redirect, a 404 error or anything else
1111
you can dream up. The controller contains whatever arbitrary logic *your
1212
application* needs to render the content of a page.
1313

14-
See how simple this is by looking at a Symfony2 controller in action.
14+
See how simple this is by looking at a Symfony controller in action.
1515
The following controller would render a page that simply prints ``Hello world!``::
1616

1717
use Symfony\Component\HttpFoundation\Response;
@@ -50,7 +50,7 @@ common examples:
5050
Requests, Controller, Response Lifecycle
5151
----------------------------------------
5252

53-
Every request handled by a Symfony2 project goes through the same simple lifecycle.
53+
Every request handled by a Symfony project goes through the same simple lifecycle.
5454
The framework takes care of the repetitive tasks and ultimately executes a
5555
controller, which houses your custom application code:
5656

@@ -87,7 +87,7 @@ A Simple Controller
8787
-------------------
8888

8989
While a controller can be any PHP callable (a function, method on an object,
90-
or a ``Closure``), in Symfony2, a controller is usually a single method inside
90+
or a ``Closure``), in Symfony, a controller is usually a single method inside
9191
a controller object. Controllers are also called *actions*.
9292

9393
.. code-block:: php
@@ -117,7 +117,7 @@ a controller object. Controllers are also called *actions*.
117117

118118
This controller is pretty straightforward:
119119

120-
* *line 4*: Symfony2 takes advantage of PHP 5.3 namespace functionality to
120+
* *line 4*: Symfony takes advantage of PHP 5.3 namespace functionality to
121121
namespace the entire controller class. The ``use`` keyword imports the
122122
``Response`` class, which the controller must return.
123123

@@ -185,8 +185,8 @@ controller and passes in ``ryan`` for the ``$name`` variable. Creating a
185185
"page" means simply creating a controller method and associated route.
186186

187187
Notice the syntax used to refer to the controller: ``AcmeHelloBundle:Hello:index``.
188-
Symfony2 uses a flexible string notation to refer to different controllers.
189-
This is the most common syntax and tells Symfony2 to look for a controller
188+
Symfony uses a flexible string notation to refer to different controllers.
189+
This is the most common syntax and tells Symfony to look for a controller
190190
class called ``HelloController`` inside a bundle named ``AcmeHelloBundle``. The
191191
method ``indexAction()`` is then executed.
192192

@@ -232,7 +232,7 @@ passed to that method::
232232

233233
The controller has a single argument, ``$name``, which corresponds to the
234234
``{name}`` parameter from the matched route (``ryan`` in the example). In
235-
fact, when executing your controller, Symfony2 matches each argument of
235+
fact, when executing your controller, Symfony matches each argument of
236236
the controller with a parameter from the matched route. Take the following
237237
example:
238238

@@ -369,7 +369,7 @@ Use it! See :doc:`/cookbook/templating/render_without_controller`.
369369
The Base Controller Class
370370
-------------------------
371371

372-
For convenience, Symfony2 comes with a base ``Controller`` class that assists
372+
For convenience, Symfony comes with a base ``Controller`` class that assists
373373
with some of the most common controller tasks and gives your controller class
374374
access to any resource it might need. By extending this ``Controller`` class,
375375
you can take advantage of several helper methods.
@@ -393,7 +393,7 @@ Add the ``use`` statement atop the ``Controller`` class and then modify the
393393

394394
This doesn't actually change anything about how your controller works. In
395395
the next section, you'll learn about the helper methods that the base controller
396-
class makes available. These methods are just shortcuts to using core Symfony2
396+
class makes available. These methods are just shortcuts to using core Symfony
397397
functionality that's available to you with or without the use of the base
398398
``Controller`` class. A great way to see the core functionality in action
399399
is to look in the
@@ -427,7 +427,7 @@ Common Controller Tasks
427427
Though a controller can do virtually anything, most controllers will perform
428428
the same basic tasks over and over again. These tasks, such as redirecting,
429429
forwarding, rendering templates and accessing core services, are very easy
430-
to manage in Symfony2.
430+
to manage in Symfony.
431431

432432
.. index::
433433
single: Controller; Redirecting
@@ -501,15 +501,15 @@ look something like the following::
501501
}
502502

503503
And just like when creating a controller for a route, the order of the arguments
504-
to ``fancyAction`` doesn't matter. Symfony2 matches the index key names
504+
to ``fancyAction`` doesn't matter. Symfony matches the index key names
505505
(e.g. ``name``) with the method argument names (e.g. ``$name``). If you
506-
change the order of the arguments, Symfony2 will still pass the correct
506+
change the order of the arguments, Symfony will still pass the correct
507507
value to each variable.
508508

509509
.. tip::
510510

511511
Like other base ``Controller`` methods, the ``forward`` method is just
512-
a shortcut for core Symfony2 functionality. A forward can be accomplished
512+
a shortcut for core Symfony functionality. A forward can be accomplished
513513
directly by duplicating the current request. When this
514514
:ref:`sub request <http-kernel-sub-requests>` is executed via the ``http_kernel``
515515
service the ``HttpKernel`` returns a ``Response`` object::
@@ -603,7 +603,7 @@ The Symfony templating engine is explained in great detail in the
603603
Accessing other Services
604604
~~~~~~~~~~~~~~~~~~~~~~~~
605605

606-
When extending the base controller class, you can access any Symfony2 service
606+
When extending the base controller class, you can access any Symfony service
607607
via the ``get()`` method. Here are several common services you might need::
608608

609609
$templating = $this->get('templating');
@@ -648,7 +648,7 @@ The ``createNotFoundException()`` method creates a special ``NotFoundHttpExcepti
648648
object, which ultimately triggers a 404 HTTP response inside Symfony.
649649

650650
Of course, you're free to throw any ``Exception`` class in your controller -
651-
Symfony2 will automatically return a 500 HTTP response code.
651+
Symfony will automatically return a 500 HTTP response code.
652652

653653
.. code-block:: php
654654
@@ -666,9 +666,9 @@ Both of these error pages can be customized. For details, read the
666666
Managing the Session
667667
--------------------
668668

669-
Symfony2 provides a nice session object that you can use to store information
669+
Symfony provides a nice session object that you can use to store information
670670
about the user (be it a real person using a browser, a bot, or a web service)
671-
between requests. By default, Symfony2 stores the attributes in a cookie
671+
between requests. By default, Symfony stores the attributes in a cookie
672672
by using the native PHP sessions.
673673

674674
Storing and retrieving information from the session can be easily achieved

book/doctrine.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ for you:
125125
126126
.. sidebar:: Setting up the Database to be UTF8
127127

128-
One mistake even seasoned developers make when starting a Symfony2 project
128+
One mistake even seasoned developers make when starting a Symfony project
129129
is forgetting to setup default charset and collation on their database,
130130
ending up with latin type collations, which are default for most databases.
131131
They might even remember to do it the very first time, but forget that

book/forms.rst

+10-10
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ Forms
55
=====
66

77
Dealing with HTML forms is one of the most common - and challenging - tasks for
8-
a web developer. Symfony2 integrates a Form component that makes dealing with
8+
a web developer. Symfony integrates a Form component that makes dealing with
99
forms easy. In this chapter, you'll build a complex form from the ground-up,
1010
learning the most important features of the form library along the way.
1111

1212
.. note::
1313

1414
The Symfony Form component is a standalone library that can be used outside
15-
of Symfony2 projects. For more information, see the `Symfony2 Form component`_
15+
of Symfony projects. For more information, see the `Symfony Form component`_
1616
on GitHub.
1717

1818
.. index::
@@ -80,7 +80,7 @@ Building the Form
8080
~~~~~~~~~~~~~~~~~
8181

8282
Now that you've created a ``Task`` class, the next step is to create and
83-
render the actual HTML form. In Symfony2, this is done by building a form
83+
render the actual HTML form. In Symfony, this is done by building a form
8484
object and then rendering it in a template. For now, this can all be done
8585
from inside a controller::
8686

@@ -119,7 +119,7 @@ from inside a controller::
119119
how to build your form in a standalone class, which is recommended as
120120
your form becomes reusable.
121121

122-
Creating a form requires relatively little code because Symfony2 form objects
122+
Creating a form requires relatively little code because Symfony form objects
123123
are built with a "form builder". The form builder's purpose is to allow you
124124
to write simple form "recipes", and have it do all the heavy-lifting of actually
125125
building the form.
@@ -136,7 +136,7 @@ the server.
136136
Support for submit buttons was introduced in Symfony 2.3. Before that, you had
137137
to add buttons to the form's HTML manually.
138138

139-
Symfony2 comes with many built-in types that will be discussed shortly
139+
Symfony comes with many built-in types that will be discussed shortly
140140
(see :ref:`book-forms-type-reference`).
141141

142142
.. index::
@@ -318,7 +318,7 @@ Form Validation
318318
---------------
319319

320320
In the previous section, you learned how a form can be submitted with valid
321-
or invalid data. In Symfony2, validation is applied to the underlying object
321+
or invalid data. In Symfony, validation is applied to the underlying object
322322
(e.g. ``Task``). In other words, the question isn't whether the "form" is
323323
valid, but whether or not the ``$task`` object is valid after the form has
324324
applied the submitted data to it. Calling ``$form->isValid()`` is a shortcut
@@ -441,7 +441,7 @@ corresponding errors printed out with the form.
441441
'attr' => array('novalidate' => 'novalidate'),
442442
)) ?>
443443

444-
Validation is a very powerful feature of Symfony2 and has its own
444+
Validation is a very powerful feature of Symfony and has its own
445445
:doc:`dedicated chapter </book/validation>`.
446446

447447
.. index::
@@ -982,9 +982,9 @@ to the ``form()`` or the ``form_start()`` helper:
982982

983983
.. note::
984984

985-
If the form's method is not GET or POST, but PUT, PATCH or DELETE, Symfony2
985+
If the form's method is not GET or POST, but PUT, PATCH or DELETE, Symfony
986986
will insert a hidden field with the name ``_method`` that stores this method.
987-
The form will be submitted in a normal POST request, but Symfony2's router
987+
The form will be submitted in a normal POST request, but Symfony's router
988988
is capable of detecting the ``_method`` parameter and will interpret it as
989989
a PUT, PATCH or DELETE request. Read the cookbook chapter
990990
":doc:`/cookbook/routing/method_parameters`" for more information.
@@ -1901,7 +1901,7 @@ Learn more from the Cookbook
19011901
* :doc:`/cookbook/form/dynamic_form_modification`
19021902
* :doc:`/cookbook/form/data_transformers`
19031903

1904-
.. _`Symfony2 Form component`: https://github.com/symfony/Form
1904+
.. _`Symfony Form component`: https://github.com/symfony/Form
19051905
.. _`DateTime`: http://php.net/manual/en/class.datetime.php
19061906
.. _`Twig Bridge`: https://github.com/symfony/symfony/tree/master/src/Symfony/Bridge/Twig
19071907
.. _`form_div_layout.html.twig`: https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig

0 commit comments

Comments
 (0)