Skip to content

Removing uses of we from several book pages #1882

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 3, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions book/controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ maps a URL to that controller (#2).
.. note::

Though similarly named, a "front controller" is different from the
"controllers" we'll talk about in this chapter. A front controller
"controllers" talked about in this chapter. A front controller
is a short PHP file that lives in your web directory and through which
all requests are directed. A typical application will have a production
front controller (e.g. ``app.php``) and a development front controller
Expand Down Expand Up @@ -324,7 +324,7 @@ working with forms, for example::
public function updateAction(Request $request)
{
$form = $this->createForm(...);

$form->bindRequest($request);
// ...
}
Expand Down Expand Up @@ -441,7 +441,7 @@ object that's returned from that controller::
));

// ... further modify the response or return it directly

return $response;
}

Expand Down Expand Up @@ -470,7 +470,7 @@ value to each variable.
a shortcut for core Symfony2 functionality. A forward can be accomplished
directly via the ``http_kernel`` service. A forward returns a ``Response``
object::

$httpKernel = $this->container->get('http_kernel');
$response = $httpKernel->forward('AcmeHelloBundle:Hello:fancy', array(
'name' => $name,
Expand Down Expand Up @@ -509,7 +509,7 @@ The Symfony templating engine is explained in great detail in the

The ``renderView`` method is a shortcut to direct use of the ``templating``
service. The ``templating`` service can also be used directly::

$templating = $this->get('templating');
$content = $templating->render('AcmeHelloBundle:Hello:index.html.twig', array('name' => $name));

Expand Down Expand Up @@ -662,7 +662,7 @@ the ``notice`` message:
{% endif %}

.. code-block:: php

<?php if ($view['session']->hasFlash('notice')): ?>
<div class="flash-notice">
<?php echo $view['session']->getFlash('notice') ?>
Expand All @@ -686,7 +686,7 @@ headers and content that's sent back to the client::

// create a simple Response with a 200 status code (the default)
$response = new Response('Hello '.$name, 200);

// create a JSON-response with a 200 status code
$response = new Response(json_encode(array('name' => $name)));
$response->headers->set('Content-Type', 'application/json');
Expand Down
16 changes: 8 additions & 8 deletions book/from_flat_php_to_symfony2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ better software than with flat PHP, you'll see for yourself.
In this chapter, you'll write a simple application in flat PHP, and then
refactor it to be more organized. You'll travel through time, seeing the
decisions behind why web development has evolved over the past several years
to where it is now.
to where it is now.

By the end, you'll see how Symfony2 can rescue you from mundane tasks and
let you take back control of your code.
Expand Down Expand Up @@ -134,7 +134,7 @@ to the area of *your* code that processes user input and prepares the response.
In this case, our controller prepares data from the database and then includes
a template to present that data. With the controller isolated, you could
easily change *just* the template file if you needed to render the blog
entries in some other format (e.g. ``list.json.php`` for JSON format).
entries in some other format (e.g. ``list.json.php`` for JSON format).

Isolating the Application (Domain) Logic
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -532,7 +532,7 @@ The Sample Application in Symfony2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The blog has come a *long* way, but it still contains a lot of code for such
a simple application. Along the way, we've also invented a simple routing
a simple application. Along the way, you've made a simple routing
system and a method using ``ob_start()`` and ``ob_get_clean()`` to render
templates. If, for some reason, you needed to continue building this "framework"
from scratch, you could at least use Symfony's standalone `Routing`_ and
Expand Down Expand Up @@ -564,7 +564,7 @@ them for you. Here's the same sample application, now built in Symfony2::
->getRepository('AcmeBlogBundle:Post')
->find($id)
;

if (!$post) {
// cause the 404 page not found to be displayed
throw $this->createNotFoundException();
Expand All @@ -581,7 +581,7 @@ now quite a bit simpler:

.. code-block:: html+php

<!-- src/Acme/BlogBundle/Resources/views/Blog/list.html.php -->
<!-- src/Acme/BlogBundle/Resources/views/Blog/list.html.php -->
<?php $view->extend('::layout.html.php') ?>

<?php $view['slots']->set('title', 'List of Posts') ?>
Expand Down Expand Up @@ -614,7 +614,7 @@ The layout is nearly identical:

.. note::

We'll leave the show template as an exercise, as it should be trivial to
The show template is left as an exercise, as it should be trivial to
create based on the list template.

When Symfony2's engine (called the ``Kernel``) boots up, it needs a map so
Expand Down Expand Up @@ -730,8 +730,8 @@ The corresponding ``layout.html.twig`` template is also easier to write:
</html>

Twig is well-supported in Symfony2. And while PHP templates will always
be supported in Symfony2, we'll continue to discuss the many advantages of
Twig. For more information, see the :doc:`templating chapter</book/templating>`.
be supported in Symfony2, the many advantages of Twig will continue to
be discussed. For more information, see the :doc:`templating chapter</book/templating>`.

Learn more from the Cookbook
----------------------------
Expand Down
14 changes: 7 additions & 7 deletions book/page_creation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,10 @@ application should greet you:
.. code-block:: text

http://localhost/app.php/hello/Ryan

If you get an error, it's likely because you need to clear your cache
by running:

.. code-block:: bash

$ php app/console cache:clear --env=prod --no-debug
Expand Down Expand Up @@ -299,8 +299,8 @@ of writing the HTML inside the controller, render a template instead:

.. note::

In order to use the :method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller::render`
method, your controller must extend the
In order to use the :method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller::render`
method, your controller must extend the
:class:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller` class,
which adds shortcuts for tasks that are common inside controllers. This
is done in the above example by adding the ``use`` statement on line 4
Expand Down Expand Up @@ -476,7 +476,7 @@ use a Kernel class, ``AppKernel``, to bootstrap the application.
http://localhost/hello/Ryan

Though front controllers are essential in handling every request, you'll
rarely need to modify or even think about them. We'll mention them again
rarely need to modify or even think about them. They'll be mentioned again
briefly in the `Environments`_ section.

The Application (``app``) Directory
Expand Down Expand Up @@ -731,7 +731,7 @@ format you prefer:
imports:
- { resource: parameters.ini }
- { resource: security.yml }

framework:
secret: "%secret%"
charset: UTF-8
Expand All @@ -758,7 +758,7 @@ format you prefer:
<import resource="parameters.ini" />
<import resource="security.yml" />
</imports>

<framework:config charset="UTF-8" secret="%secret%">
<framework:router resource="%kernel.root_dir%/config/routing.xml" />
<framework:form />
Expand Down
6 changes: 3 additions & 3 deletions book/security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ Users
-----

In the previous sections, you learned how you can protect different resources
by requiring a set of *roles* for a resource. In this section we'll explore
by requiring a set of *roles* for a resource. This section explores
the other side of authorization: users.

Where do Users come from? (*User Providers*)
Expand Down Expand Up @@ -1199,7 +1199,7 @@ look like::
method of an anonymous user object will return true. To check if your
user is actually authenticated, check for the ``IS_AUTHENTICATED_FULLY``
role.

In a Twig Template this object can be accessed via the ``app.user`` key,
which calls the :method:`GlobalVariables::getUser()<Symfony\\Bundle\\FrameworkBundle\\Templating\\GlobalVariables::getUser>`
method:
Expand Down Expand Up @@ -1570,7 +1570,7 @@ Access Control in Controllers
-----------------------------

If you want to check if the current user has a role in your controller, use
the :method:`Symfony\\Component\\Security\\Core\\SecurityContext::isGranted`
the :method:`Symfony\\Component\\Security\\Core\\SecurityContext::isGranted`
method of the security context::

public function indexAction()
Expand Down
24 changes: 12 additions & 12 deletions book/templating.rst
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ Template Inheritance and Layouts
--------------------------------

More often than not, templates in a project share common elements, like the
header, footer, sidebar or more. In Symfony2, we like to think about this
problem differently: a template can be decorated by another one. This works
header, footer, sidebar or more. In Symfony2, this problem is thought about
differently: a template can be decorated by another one. This works
exactly the same as PHP classes: template inheritance allows you to build
a base "layout" template that contains all the common elements of your site
defined as **blocks** (think "PHP class with base methods"). A child template
Expand Down Expand Up @@ -468,8 +468,8 @@ ease the work of the template designer. In PHP, the templating system provides
an extensible *helper* system that provides useful features in a template
context.

We've already seen a few built-in Twig tags (``{% block %}`` & ``{% extends %}``)
as well as an example of a PHP helper (``$view['slots']``). Let's learn a
You've already seen a few built-in Twig tags (``{% block %}`` & ``{% extends %}``)
as well as an example of a PHP helper (``$view['slots']``). Here you will learn a
few more.

.. index::
Expand Down Expand Up @@ -551,7 +551,7 @@ template using the ``with`` command.
.. tip::

The ``{'article': article}`` syntax is the standard Twig syntax for hash
maps (i.e. an array with named keys). If we needed to pass in multiple
maps (i.e. an array with named keys). If you needed to pass in multiple
elements, it would look like this: ``{'foo': foo, 'bar': bar}``.

.. index::
Expand Down Expand Up @@ -607,7 +607,7 @@ The ``recentList`` template is perfectly straightforward:

.. note::

Notice that we've cheated and hardcoded the article URL in this example
Notice that the article URL is hardcoded in this example
(e.g. ``/article/*slug*``). This is a bad practice. In the next section,
you'll learn how to do this correctly.

Expand Down Expand Up @@ -810,7 +810,7 @@ advantage of Symfony's template inheritance.
This section will teach you the philosophy behind including stylesheet
and Javascript assets in Symfony. Symfony also packages another library,
called Assetic, which follows this philosophy but allows you to do much
more interesting things with those assets. For more information on
more interesting things with those assets. For more information on
using Assetic see :doc:`/cookbook/assetic/asset_management`.


Expand Down Expand Up @@ -851,13 +851,13 @@ page. From inside that contact page's template, do the following:

{% block stylesheets %}
{{ parent() }}

<link href="{{ asset('/css/contact.css') }}" type="text/css" rel="stylesheet" />
{% endblock %}

{# ... #}

In the child template, you simply override the ``stylesheets`` block and
In the child template, you simply override the ``stylesheets`` block and
put your new stylesheet tag inside of that block. Of course, since you want
to add to the parent block's content (and not actually *replace* it), you
should use the ``parent()`` Twig function to include everything from the ``stylesheets``
Expand Down Expand Up @@ -1063,7 +1063,7 @@ Three-level Inheritance
-----------------------

One common way to use inheritance is to use a three-level approach. This
method works perfectly with the three different types of templates we've just
method works perfectly with the three different types of templates that were just
covered:

* Create a ``app/Resources/views/base.html.twig`` file that contains the main
Expand Down Expand Up @@ -1282,7 +1282,7 @@ pattern is to do the following::
public function indexAction()
{
$format = $this->getRequest()->getRequestFormat();

return $this->render('AcmeBlogBundle:Blog:index.'.$format.'.twig');
}

Expand Down
16 changes: 8 additions & 8 deletions book/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,11 @@ document::

request(
$method,
$uri,
array $parameters = array(),
array $files = array(),
array $server = array(),
$content = null,
$uri,
array $parameters = array(),
array $files = array(),
array $server = array(),
$content = null,
$changeHistory = true
)

Expand Down Expand Up @@ -434,8 +434,8 @@ it automatically. You can examine the response and force a redirection
afterwards with the ``followRedirect()`` method::

$crawler = $client->followRedirect();
If you want the client to automatically follow all redirects, you can

If you want the client to automatically follow all redirects, you can
force him with the ``followRedirects()`` method::

$client->followRedirects();
Expand Down Expand Up @@ -561,7 +561,7 @@ Just like links, you select forms with the ``selectButton()`` method::

.. note::

Notice that we select form buttons and not forms as a form can have several
Notice that you select form buttons and not forms as a form can have several
buttons; if you use the traversing API, keep in mind that you must look for a
button.

Expand Down
Loading