Skip to content

Add info about security.firewall.context in pitfall #2172

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 22 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4317e2a
Documenting how we should use the versionadded tag - see https://grou…
weaverryan Jan 15, 2013
163f6d5
askAndConfirm should return user's input to properly work.
Jan 15, 2013
7bfff13
Fixed typos
Jan 15, 2013
c9b1cb4
[#1382] Fixed jQuery bug
wouterj Jan 19, 2013
8697bbc
Improved jQuery code
wouterj Jan 19, 2013
f3f7068
Fixed sphinx syntax
wouterj Jan 19, 2013
ee6739d
Fixed code, thanks to @stof
wouterj Jan 20, 2013
b723781
Moving registering extension above loading config in DI code sample
richardmiller-zz Jan 20, 2013
6e65171
Adding a note about finding more examples of working with DI definitions
richardmiller-zz Jan 20, 2013
e4b9f17
Re-adding deleted semicolon
richardmiller-zz Jan 20, 2013
3f27c94
[#961] Clarifying what the DomDocument component is intended to do / …
weaverryan Jan 20, 2013
6145217
Merge pull request #2158 from WouterJ/issue_1382
weaverryan Jan 20, 2013
d88c391
Merge pull request #2162 from richardmiller/adding_di_example_note
weaverryan Jan 20, 2013
2e8bb8b
[#2162] Fixing typo
weaverryan Jan 20, 2013
a928fa3
Merge pull request #2160 from richardmiller/correcting_di_example_order
weaverryan Jan 20, 2013
49c4ecf
Merge pull request #2161 from richardmiller/adding_di_note
weaverryan Jan 20, 2013
dbcd3cd
Merge pull request #2139 from tyler-king/2.0
weaverryan Jan 20, 2013
893199c
Adding a link to the Doctrine chapter per a comment from @rpmsk
weaverryan Jan 20, 2013
fbb6196
[#961] Tweaks per @WouterJ and @jakzal
weaverryan Jan 20, 2013
43d1fa7
Merge pull request #2138 from symfony/versionadded
weaverryan Jan 20, 2013
a3043db
[#2138] Typo fix per @Stof
weaverryan Jan 20, 2013
8c53a12
Update book/security.rst
morgen2009 Jan 21, 2013
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
2 changes: 1 addition & 1 deletion book/from_flat_php_to_symfony2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ them for you. Here's the same sample application, now built in Symfony2::
}
}

The two controllers are still lightweight. Each uses the Doctrine ORM library
The two controllers are still lightweight. Each uses the :doc:`Doctrine ORM library</book/doctrine>`
to retrieve objects from the database and the ``Templating`` component to
render a template and return a ``Response`` object. The list template is
now quite a bit simpler:
Expand Down
3 changes: 2 additions & 1 deletion book/security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,8 @@ see :doc:`/cookbook/security/form_login`.

If you're using multiple firewalls and you authenticate against one firewall,
you will *not* be authenticated against any other firewalls automatically.
Different firewalls are like different security systems. That's why,
Different firewalls are like different security systems. To do this you have
to explicitly specify the same context for different firewalls. But usually
for most applications, having one main firewall is enough.

Authorization
Expand Down
5 changes: 3 additions & 2 deletions components/console/helpers/dialoghelper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ method::
'The name of the bundle should be suffixed with \'Bundle\''
);
}
return $answer;
},
false,
'AcmeDemoBundle'
Expand All @@ -89,8 +90,8 @@ This methods has 2 new arguments, the full signature is::

The ``$validator`` is a callback which handles the validation. It should
throw an exception if there is something wrong. The exception message is displayed
in the console, so it is a good practice to put some useful information
in it.
in the console, so it is a good practice to put some useful information in it. The callback
function should also return the value of the user's input if the validation was successful.

You can set the max number of times to ask in the ``$attempts`` argument.
If you reach this max number it will use the default value, which is given
Expand Down
3 changes: 2 additions & 1 deletion components/dependency_injection/compilation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,11 @@ processed when the container is compiled at which point the Extensions are loade
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;

$container = new ContainerBuilder();
$container->registerExtension(new AcmeDemoExtension);

$loader = new YamlFileLoader($container, new FileLocator(__DIR__));
$loader->load('config.yml');

$container->registerExtension(new AcmeDemoExtension);
// ...
$container->compile();

Expand Down
12 changes: 9 additions & 3 deletions components/dependency_injection/definitions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Getting and Setting Service Definitions
There are also some helpful methods for
working with the service definitions.

To find out if there is a definition for a service id::
To find out if there is a definition for a service id::

$container->hasDefinition($serviceId);

Expand Down Expand Up @@ -84,7 +84,7 @@ To get an array of the constructor arguments for a definition you can use::

or to get a single argument by its position::

$definition->getArgument($index);
$definition->getArgument($index);
//e.g. $definition->getArguments(0) for the first argument

You can add a new argument to the end of the arguments array using::
Expand All @@ -95,7 +95,7 @@ The argument can be a string, an array, a service parameter by using ``%paramete
or a service id by using ::

use Symfony\Component\DependencyInjection\Reference;

// ...

$definition->addArgument(new Reference('service_id'));
Expand Down Expand Up @@ -131,3 +131,9 @@ You can also replace any existing method calls with an array of new ones with::

$definition->setMethodCalls($methodCalls);

.. tip::

There are more examples of specific ways of working with definitions
in the PHP code blocks of the configuration examples on pages such as
:doc:`/components/dependency_injection/factories` and
:doc:`/components/dependency_injection/parentservices`.
21 changes: 21 additions & 0 deletions components/dom_crawler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ The DomCrawler Component

The DomCrawler Component eases DOM navigation for HTML and XML documents.

.. note::

While possible, the DomCrawler component is not designed for manipulation
of the DOM or re-dumping HTML/XML.

Installation
------------

Expand Down Expand Up @@ -172,6 +177,22 @@ and :phpclass:`DOMNode` objects:
$crawler->addNode($node);
$crawler->add($document);

.. sidebar:: Manipulating and Dumping a ``Crawler``

These methods on the ``Crawler`` are intended to initially populate your
``Crawler`` and aren't intended to be used to further manipulate a DOM
(though this is possible). However, since the ``Crawler`` is a set of
:phpclass:`DOMElement` objects, you can use any method or property available
on :phpclass:`DOMElement`, :phpclass:`DOMNode` or :phpclass:`DOMDocument`.
For example, you could get the HTML of a ``Crawler`` with something like
this::

$html = '';

foreach ($crawler as $domElement) {
$html.= $domElement->ownerDocument->saveHTML();
}

Form and Link support
~~~~~~~~~~~~~~~~~~~~~

Expand Down
30 changes: 30 additions & 0 deletions contributing/documentation/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,36 @@ An example submission could now look as follows:
by going to the `Documentation Build Errors`_ page (it is updated each French
night at 3AM when the server rebuilds the documentation).

Documenting new Features or Behavior Changes
--------------------------------------------

If you're documenting a brand new feature or a change that's been made in
Symfony2, you should precede your description of the change with a ``.. versionadded:: 2.X``
tag and a short description:

.. code-block:: text

.. versionadded:: 2.2
The ``askHiddenResponse`` method was added in Symfony 2.2.

You can also ask a question and hide the response. This is particularly...

If you're documenting a behavior change, it may be helpful to *briefly* describe
how the behavior has changed.

.. code-block:: text

.. versionadded:: 2.2
The ``include()`` function is a new Twig feature that's available in
Symfony 2.2. Prior, the ``{% include %}`` tag was used.

Whenever a new minor version of Symfony2 is released (e.g. 2.3, 2.4, etc),
a new branch of the documentation is created from the ``master`` branch.
At this point, all the ``versionadded`` tags for Symfony2 versions that have
reached end-of-life will be removed. For example, if Symfony 2.5 were released
today, and 2.2 had recently reached its end-of-life, the 2.2 ``versionadded``
tags would be removed from the new 2.5 branch.

Standards
---------

Expand Down
17 changes: 12 additions & 5 deletions cookbook/form/form_collections.rst
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,10 @@ will be show next):
// add the "add a tag" anchor and li to the tags ul
collectionHolder.append($newLinkLi);

// count the current form inputs we have (e.g. 2), use that as the new
// index when inserting a new item (e.g. 2)
collectionHolder.data('index', collectionHolder.find(':input').length);

$addTagLink.on('click', function(e) {
// prevent the link from creating a "#" on the URL
e.preventDefault();
Expand All @@ -391,21 +395,24 @@ one example:

function addTagForm(collectionHolder, $newLinkLi) {
// Get the data-prototype explained earlier
var prototype = collectionHolder.attr('data-prototype');
var prototype = collectionHolder.data('prototype');

// count the current form inputs we have (e.g. 2), use that as the new index (e.g. 2)
var newIndex = collectionHolder.find(':input').length;
// get the new index
var index = collectionHolder.data('index');

// Replace '$$name$$' in the prototype's HTML to
// instead be a number based on how many items we have
var newForm = prototype.replace(/\$\$name\$\$/g, newIndex);
var newForm = prototype.replace(/\$\$name\$\$/g, index);

// increase the index with one for the next item
collectionHolder.data('index', index + 1);

// Display the form in the page in an li, before the "Add a tag" link li
var $newFormLi = $('<li></li>').append(newForm);
$newLinkLi.before($newFormLi);
}

.. note:
.. note::

It is better to separate your javascript in real JavaScript files than
to write it inside the HTML as is done here.
Expand Down