Thanks to visit codestin.com
Credit goes to github.com

Skip to content

lots of minor tweaks and fixes #7737

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 23 commits 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
2 changes: 1 addition & 1 deletion assetic/asset_management.rst
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ configuration under the ``assetic`` section. Read more in the
),
),
),
);
));

After you have defined the named assets, you can reference them in your templates
with the ``@named_asset`` notation:
Expand Down
3 changes: 1 addition & 2 deletions assetic/jpeg_optimize.rst
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ following configuration:
),
'twig' => array(
'functions' => array('jpegoptim'),
),
),
));

Expand Down Expand Up @@ -294,7 +293,7 @@ file:
'twig' => array(
'functions' => array(
'jpegoptim' => array(
output => 'images/*.jpg'
'output' => 'images/*.jpg'
),
),
),
Expand Down
8 changes: 4 additions & 4 deletions assetic/uglifyjs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@ can configure its location using the ``node`` key:

// app/config/config.php
$container->loadFromExtension('assetic', array(
'node' => '/usr/bin/nodejs',
'node' => '/usr/bin/nodejs',
'uglifyjs2' => array(
// the path to the uglifyjs executable
'bin' => '/usr/local/bin/uglifyjs',
),
// the path to the uglifyjs executable
'bin' => '/usr/local/bin/uglifyjs',
),
));

Minify your Assets
Expand Down
5 changes: 4 additions & 1 deletion components/routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@ to find a route that fits the given request you can also build a URL from
a certain route::

use Symfony\Component\Routing\Generator\UrlGenerator;
use Symfony\Component\Routing\RequestContext;
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCollection;

$routes = new RouteCollection();
$routes->add('show_post', new Route('/show/{slug}'));
Expand Down Expand Up @@ -321,7 +324,7 @@ a path to the main route definition and some other settings::
$resource,
array $options = array(),
RequestContext $context = null,
array $defaults = array()
LoggerInterface $logger = null
);

With the ``cache_dir`` option you can enable route caching (if you provide a
Expand Down
2 changes: 2 additions & 0 deletions components/security/authentication.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ The default authentication manager is an instance of
:class:`Symfony\\Component\\Security\\Core\\Authentication\\AuthenticationProviderManager`::

use Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager;
use Symfony\Component\Security\Core\Exception\AuthenticationException;

// instances of Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProviderInterface
$providers = array(...);
Expand Down Expand Up @@ -234,6 +235,7 @@ own, it just needs to follow these rules:
}

// ...
}
}

Using Password Encoders
Expand Down
2 changes: 1 addition & 1 deletion configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ configure DoctrineBundle and other parts of Symfony:
.. code-block:: php

// app/config/config.php
$configuration->loadFromExtension('doctrine', array(
$container->loadFromExtension('doctrine', array(
'dbal' => array(
'driver' => 'pdo_mysql',
// ...
Expand Down
2 changes: 1 addition & 1 deletion configuration/environments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ The best way to accomplish this is via a new environment called, for example,
.. code-block:: php

// app/config/config_benchmark.php
$loader->import('config_prod.php')
$loader->import('config_prod.php');

$container->loadFromExtension('framework', array(
'profiler' => array('only_exceptions' => false),
Expand Down
2 changes: 1 addition & 1 deletion controller/service.rst
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ controller:
$templating = $this->templating;
$callback = function () use ($templating, $view, $parameters) {
$templating->stream($view, $parameters);
}
};

return new StreamedResponse($callback);

Expand Down
2 changes: 1 addition & 1 deletion doctrine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ information. By convention, this information is usually configured in an
.. code-block:: php

// app/config/config.php
$configuration->loadFromExtension('doctrine', array(
$container->loadFromExtension('doctrine', array(
'dbal' => array(
'driver' => 'pdo_mysql',
'host' => '%database_host%',
Expand Down
2 changes: 1 addition & 1 deletion form/action_method.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ to the ``form()`` or the ``form_start()`` helper functions:

.. code-block:: html+php

<!-- app/Resources/views/default/newAction.html.php -->
<!-- app/Resources/views/default/new.html.php -->
<?php echo $view['form']->start($form, array(
'action' => $view['router']->generate('target_route'),
'method' => 'GET',
Expand Down
2 changes: 1 addition & 1 deletion form/create_form_type_extension.rst
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ tag:

$container
->register('app.image_type_extension', ImageTypeExtension::class)
->addTag('form.type_extension', array('alias' => 'file'));
->addTag('form.type_extension', array('alias' => 'file'))
;

The ``alias`` key of the tag is the type of field that this extension should
Expand Down
2 changes: 1 addition & 1 deletion form/data_transformers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Suppose you have a Task form with a tags ``text`` type::
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('tags', 'text')
$builder->add('tags', 'text');
}

public function configureOptions(OptionsResolver $resolver)
Expand Down
2 changes: 1 addition & 1 deletion form/without_class.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,4 @@ but here's a short example:

.. code-block:: php

new NotBlank(array('groups' => array('create', 'update')))
new NotBlank(array('groups' => array('create', 'update')));
4 changes: 2 additions & 2 deletions http_cache/cache_invalidation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ Here is how you can configure the Symfony reverse proxy to support the

$response = new Response();
if ($this->getStore()->purge($request->getUri())) {
$response->setStatusCode(200, 'Purged');
$response->setStatusCode(Response::HTTP_OK, 'Purged');
} else {
$response->setStatusCode(404, 'Not found');
$response->setStatusCode(Response::HTTP_NOT_FOUND, 'Not found');
}

return $response;
Expand Down
9 changes: 6 additions & 3 deletions http_cache/esi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,10 @@ matter), Symfony uses the standard ``render`` helper to configure ESI tags:
.. code-block:: html+php

<!-- app/Resources/views/static/about.html.php -->

<?php
// you can use a controller reference
use Symfony\Component\HttpKernel\Controller\ControllerReference;
?>
<?php echo $view['actions']->render(
new ControllerReference(
'AppBundle:News:latest',
Expand All @@ -148,15 +149,17 @@ matter), Symfony uses the standard ``render`` helper to configure ESI tags:
array('strategy' => 'esi')
) ?>

<?php
// ... or a URL
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
?>
<?php echo $view['actions']->render(
$view['router']->generate(
'latest_news',
array('maxPerPage' => 5),
UrlGeneratorInterface::ABSOLUTE_URL
),
array('strategy' => 'esi'),
array('strategy' => 'esi')
) ?>

By using the ``esi`` renderer (via the ``render_esi()`` Twig function), you
Expand Down Expand Up @@ -234,7 +237,7 @@ that must be enabled in your configuration:
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:doctrine="http://symfony.com/schema/dic/framework"
xmlns:framework="http://symfony.com/schema/dic/framework"
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/symfony
Expand Down
2 changes: 1 addition & 1 deletion http_cache/expiration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Most of the time, you will use the ``Cache-Control`` header. Recall that the
``Cache-Control`` header is used to specify many different cache directives::

// Sets the number of seconds after which the response
// should no longer be considered fresh
// should no longer be considered fresh by shared caches
$response->setSharedMaxAge(600);

The ``Cache-Control`` header would take on the following format (it may have
Expand Down
4 changes: 2 additions & 2 deletions reference/constraints/CardScheme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ on an object that will contain a credit card number.
.. code-block:: php-annotations

// src/AppBundle/Entity/Transaction.php
namespace AppBundle\Entity\Transaction;
namespace AppBundle\Entity;

use Symfony\Component\Validator\Constraints as Assert;

Expand Down Expand Up @@ -76,7 +76,7 @@ on an object that will contain a credit card number.
.. code-block:: php

// src/AppBundle/Entity/Transaction.php
namespace AppBundle\Entity\Transaction;
namespace AppBundle\Entity;

use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
Expand Down
2 changes: 1 addition & 1 deletion reference/constraints/UniqueEntity.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ your user table:

.. code-block:: php

// src/AppBundle/Entity/User.php
// src/AppBundle/Entity/Author.php
namespace AppBundle\Entity;

use Symfony\Component\Validator\Constraints as Assert;
Expand Down
2 changes: 1 addition & 1 deletion reference/dic_tags.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1439,7 +1439,7 @@ If you do need to use this tag, just make a new class that implements the
:class:`Symfony\\Component\\Validator\\ObjectInitializerInterface` interface.
Then, tag it with the ``validator.initializer`` tag (it has no options).

For an example, see the ``EntityInitializer`` class inside the Doctrine
For an example, see the ``DoctrineInitializer`` class inside the Doctrine
Bridge.

.. _`Twig's documentation`: http://twig.sensiolabs.org/doc/advanced.html#creating-an-extension
Expand Down
6 changes: 4 additions & 2 deletions routing/hostname_pattern.rst
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ instance, if you want to match both ``m.example.com`` and
<?xml version="1.0" encoding="UTF-8" ?>
<routes xmlns="http://symfony.com/schema/routing"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
xsi:schemaLocation="http://symfony.com/schema/routing
http://symfony.com/schema/routing/routing-1.0.xsd">

<route id="mobile_homepage" path="/" host="m.{domain}">
<default key="_controller">AcmeDemoBundle:Main:mobileHomepage</default>
Expand Down Expand Up @@ -251,7 +252,8 @@ You can also set the host option on imported routes:
<?xml version="1.0" encoding="UTF-8" ?>
<routes xmlns="http://symfony.com/schema/routing"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
xsi:schemaLocation="http://symfony.com/schema/routing
http://symfony.com/schema/routing/routing-1.0.xsd">

<import resource="@AcmeHelloBundle/Resources/config/routing.xml" host="hello.example.com" />
</routes>
Expand Down
2 changes: 1 addition & 1 deletion routing/requirements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ accomplished with the following route configuration:

.. code-block:: php-annotations

// src/AppBundle/Controller/MainController.php
// src/AppBundle/Controller/BlogApiController.php
namespace AppBundle\Controller;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
Expand Down
8 changes: 4 additions & 4 deletions security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ configuration looks like this:
),
'firewalls' => array(
'dev' => array(
'pattern' => '^/(_(profiler|wdt)|css|images|js)/',
'security' => false,
'pattern' => '^/(_(profiler|wdt)|css|images|js)/',
'security' => false,
),
'default' => array(
'anonymous' => null,
'anonymous' => null,
),
),
));
Expand Down Expand Up @@ -257,7 +257,7 @@ user to be logged in to access this URL:
),
'access_control' => array(
// require ROLE_ADMIN for /admin*
array('path' => '^/admin', 'role' => 'ROLE_ADMIN'),
array('path' => '^/admin', 'roles' => 'ROLE_ADMIN'),
),
));

Expand Down
8 changes: 5 additions & 3 deletions security/acl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,12 @@ First, you need to configure the connection the ACL system is supposed to use:
.. code-block:: php

// app/config/security.php
$container->loadFromExtension('security', 'acl', array(
$container->loadFromExtension('security', array(
// ...

'connection' => 'default',

'acl' => array(
'connection' => 'default',
),
));

.. note::
Expand Down
2 changes: 1 addition & 1 deletion security/impersonating_user.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ to show a link to exit impersonation:
<a
href="<?php echo $view['router']->generate('homepage', array(
'_switch_user' => '_exit',
) ?>"
)) ?>"
>
Exit impersonation
</a>
Expand Down
2 changes: 1 addition & 1 deletion security/pre_authenticated.rst
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ corresponding firewall in your security configuration:
$container->loadFromExtension('security', array(
'firewalls' => array(
'secured_area' => array(
'pattern' => '^/'
'pattern' => '^/',
'remote_user' => array(
'provider' => 'your_user_provider',
),
Expand Down
2 changes: 1 addition & 1 deletion security/voters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ security configuration:
>

<config>
<access-decision-manager strategy="unanimous">
<access-decision-manager strategy="unanimous" />
</config>
</srv:container>

Expand Down
2 changes: 1 addition & 1 deletion service_container.rst
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ Injecting the dependency by the setter method just needs a change of syntax:

$container->setDefinition('app.mailer', ...);

$definition = new Definition(NewsletterManager::class)
$definition = new Definition(NewsletterManager::class);
$definition->addMethodCall('setMailer', array(
new Reference('app.mailer'),
));
Expand Down
2 changes: 2 additions & 0 deletions session/php_bridge.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ for the ``handler_id``:
'session' => array(
'storage_id' => 'session.storage.php_bridge',
'handler_id' => null,
),
));

Otherwise, if the problem is simply that you cannot avoid the application
Expand Down Expand Up @@ -77,6 +78,7 @@ the example below:
'session' => array(
'storage_id' => 'session.storage.php_bridge',
'handler_id' => 'session.storage.native_file',
),
));

.. note::
Expand Down
2 changes: 1 addition & 1 deletion templating/namespaced_paths.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ directory:
$container->loadFromExtension('twig', array(
'paths' => array(
'%kernel.root_dir%/../vendor/acme/foo-bar/templates' => 'foo_bar',
);
)
));

.. caution::
Expand Down
2 changes: 1 addition & 1 deletion testing/database.rst
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ configuration:
.. code-block:: php

// app/config/config_test.php
$configuration->loadFromExtension('doctrine', array(
$container->loadFromExtension('doctrine', array(
'dbal' => array(
'host' => 'localhost',
'dbname' => 'testdb',
Expand Down
2 changes: 1 addition & 1 deletion validation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ message:

.. code-block:: text

AppBundle\Author.name:
AppBundle\Entity\Author.name:
This value should not be blank

If you insert a value into the ``name`` property, the happy success message
Expand Down
Loading