Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
Silex
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
Silex
Commits
75556d7e
Commit
75556d7e
authored
May 26, 2012
by
Fabien Potencier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed the Symfony bridges provider as it is not needed anymore with Composer
parent
5b46a783
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
36 additions
and
82 deletions
+36
-82
doc/changelog.rst
doc/changelog.rst
+2
-0
doc/providers/index.rst
doc/providers/index.rst
+0
-1
doc/providers/symfony_bridges.rst
doc/providers/symfony_bridges.rst
+0
-52
doc/providers/twig.rst
doc/providers/twig.rst
+33
-0
src/Silex/Provider/SymfonyBridgesServiceProvider.php
src/Silex/Provider/SymfonyBridgesServiceProvider.php
+0
-28
src/Silex/Provider/TwigServiceProvider.php
src/Silex/Provider/TwigServiceProvider.php
+1
-1
No files found.
doc/changelog.rst
View file @
75556d7e
...
...
@@ -3,6 +3,8 @@ Changelog
This changelog references all backward incompatibilities as we introduce them:
* **2012-05-26**: Removed ``SymfonyBridgesServiceProvider``
* **2012-05-26**: Removed the ``translator.messages`` parameter (use
``translator.domains`` instead).
...
...
doc/providers/index.rst
View file @
75556d7e
...
...
@@ -8,7 +8,6 @@ Silex
monolog
session
swiftmailer
symfony_bridges
translation
twig
url_generator
...
...
doc/providers/symfony_bridges.rst
deleted
100644 → 0
View file @
5b46a783
SymfonyBridgesServiceProvider
=============================
The *SymfonyBridgesServiceProvider* provides additional integration between
Symfony2 components and libraries.
Parameters
----------
none
Twig
----
When the ``SymfonyBridgesServiceProvider`` is enabled, the
``TwigServiceProvider`` will provide you with the following additional
capabilities:
* **UrlGeneratorServiceProvider**: If you are using the
``UrlGeneratorServiceProvider``, you will get ``path`` and ``url`` helpers
for Twig. You can find more information in the `Symfony2 Routing
documentation
<http://symfony.com/doc/current/book/routing.html#generating-urls-from-a-template>`_.
* **TranslationServiceProvider**: If you are using the
``TranslationServiceProvider``, you will get ``trans`` and ``transchoice``
helpers for translation in Twig templates. You can find more information in
the `Symfony2 Translation documentation
<http://symfony.com/doc/current/book/translation.html#twig-templates>`_.
* **FormServiceProvider**: If you are using the ``FormServiceProvider``, you
will get a set of helpers for working with forms in templates. You can find
more information in the `Symfony2 Forms reference
<http://symfony.com/doc/current/reference/forms/twig_reference.html>`_.
Registering
-----------
.. code-block:: php
$app->register(new Silex\Provider\SymfonyBridgesServiceProvider());
.. note::
The Symfony bridges do not come with the ``silex.zip`, so you need to add
them as a dependency to your ``composer.json`` file:
.. code-block:: json
"require": {
"symfony/twig-bridge": "2.1.*",
}
doc/providers/twig.rst
View file @
75556d7e
...
...
@@ -53,6 +53,39 @@ Registering
"twig/twig": ">=1.8,<2.0-dev"
}
Symfony2 Components Integration
-------------------------------
Symfony provides a Twig bridge that provides additional integration between
some Symfony2 components and Twig. Add it as a dependency to your
``composer.json`` file:
.. code-block:: json
"require": {
"symfony/twig-bridge": "2.1.*",
}
When present, the ``TwigServiceProvider`` will provide you with the following
additional capabilities:
* **UrlGeneratorServiceProvider**: If you are using the
``UrlGeneratorServiceProvider``, you will have access to the ``path()`` and
``url()`` functions. You can find more information in the `Symfony2 Routing
documentation
<http://symfony.com/doc/current/book/routing.html#generating-urls-from-a-template>`_.
* **TranslationServiceProvider**: If you are using the
``TranslationServiceProvider``, you will get the ``trans()`` and
``transchoice()`` functions for translation in Twig templates. You can find
more information in the `Symfony2 Translation documentation
<http://symfony.com/doc/current/book/translation.html#twig-templates>`_.
* **FormServiceProvider**: If you are using the ``FormServiceProvider``, you
will get a set of helpers for working with forms in templates. You can find
more information in the `Symfony2 Forms reference
<http://symfony.com/doc/current/reference/forms/twig_reference.html>`_.
Usage
-----
...
...
src/Silex/Provider/SymfonyBridgesServiceProvider.php
deleted
100644 → 0
View file @
5b46a783
<?php
/*
* This file is part of the Silex framework.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace
Silex\Provider
;
use
Silex\Application
;
use
Silex\ServiceProviderInterface
;
/**
* Symfony bridges Provider.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class
SymfonyBridgesServiceProvider
implements
ServiceProviderInterface
{
public
function
register
(
Application
$app
)
{
$app
[
'symfony_bridges'
]
=
true
;
}
}
src/Silex/Provider/TwigServiceProvider.php
View file @
75556d7e
...
...
@@ -45,7 +45,7 @@ class TwigServiceProvider implements ServiceProviderInterface
$twig
->
addExtension
(
new
\Twig_Extension_Debug
());
}
if
(
isset
(
$app
[
'symfony_bridges'
]
))
{
if
(
class_exists
(
'Symfony\Bridge\Twig\TwigEngine'
))
{
if
(
isset
(
$app
[
'url_generator'
]))
{
$twig
->
addExtension
(
new
TwigRoutingExtension
(
$app
[
'url_generator'
]));
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment