Skip to content

Form cache typos #92

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

Closed
wants to merge 1 commit into from
Closed
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
4 changes: 2 additions & 2 deletions guides/cache/http.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ header when none is set by the developer by following these rules:
* If ``Cache-Control`` is empty, its value is set to ``private, max-age=0,
must-revalidate``;

* But if at least one ``Cache-Control`` directive is set, and no 'public' or
* But if at least one ``Cache-Control`` directive is set, and no ``public`` or
``private`` directives have been explicitly added, Symfony2 adds the
``private`` directive automatically (except when ``s-maxage`` is set).

Expand Down Expand Up @@ -183,7 +183,7 @@ which the response is considered stale." The ``Expires`` header can be set
with the ``setExpires()`` Response method. It takes a ``DateTime`` instance as
an argument::

$date = new DateTime();
$date = new \DateTime();
$date->modify('+600 seconds');

$response->setExpires($date);
Expand Down
14 changes: 10 additions & 4 deletions guides/forms/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ The standard pattern for using a form in a controller looks like this:
// src/Sensio/HelloBundle/Controller/HelloController.php
public function contactAction()
{
$contactRequest = new ContactRequest();
$form = ContactForm::create($this->get('form.context'));
$contactRequest = new ContactRequest($this->get('mailer'));
$form = ContactForm::create($this->get('form.context'), 'contact');

// If a POST request, write submitted data into $contactRequest
// and validate it
// and validate them
$form->bind($this->get('request'), $contactRequest);

// If the form has been submitted and validates...
// If the form has been submitted and validated...
if ($form->isValid()) {
$contactRequest->send();
}
Expand Down Expand Up @@ -301,11 +301,13 @@ of the form.
# src/Sensio/HelloBundle/Resources/views/Hello/contact.html.twig
{% extends 'HelloBundle::layout.html.twig' %}

{% block content %}
<form action="#" method="post">
{{ form_field(form) }}

<input type="submit" value="Send!" />
</form>
{% endblock %}

Customizing the HTML Output
---------------------------
Expand All @@ -318,20 +320,24 @@ can do so by using the other built-in form rendering helpers.
# src/Sensio/HelloBundle/Resources/views/Hello/contact.html.twig
{% extends 'HelloBundle::layout.html.twig' %}

{% block content %}
<form action="#" method="post" {{ form_enctype(form) }}>
{{ form_errors(form) }}

{% for field in form %}
{% if not field.ishidden %}
<div>
{{ form_errors(field) }}
{{ form_label(field) }}
{{ form_field(field) }}
</div>
{% endif %}
{% endfor %}

{{ form_hidden(form) }}
<input type="submit" />
</form>
{% endblock %}

Symfony2 comes with the following helpers:

Expand Down