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
5dcf618d
Commit
5dcf618d
authored
Apr 04, 2011
by
Igor Wiedler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[docs] several small adjustments
parent
628714a2
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
18 deletions
+31
-18
doc/contributing.rst
doc/contributing.rst
+4
-0
doc/extensions.rst
doc/extensions.rst
+1
-1
doc/extensions/twig.rst
doc/extensions/twig.rst
+4
-4
doc/internals.rst
doc/internals.rst
+5
-2
doc/services.rst
doc/services.rst
+16
-10
doc/usage.rst
doc/usage.rst
+1
-1
No files found.
doc/contributing.rst
View file @
5dcf618d
...
...
@@ -14,6 +14,10 @@ steps.
* Send a pull request. Bonus points for topic branches.
If you have a big change or would like to discuss something,
please join us on the `mailing list
<http://groups.google.com/group/silex-php>`.
.. note::
Any code you contribute must be licensed under the MIT
...
...
doc/extensions.rst
View file @
5dcf618d
...
...
@@ -105,7 +105,7 @@ or the PEAR Naming Convention, it is possible to autoload
classes using the ``UniversalClassLoader``.
As described in the *Services* chapter, there is an
*autoloader* service
that you can use
for this.
*autoloader* service
which can be used
for this.
Here is an example of how to use it (based on `Buzz <https://github.com/kriswallsmith/Buzz>`_)::
...
...
doc/extensions/twig.rst
View file @
5dcf618d
...
...
@@ -24,14 +24,14 @@ Parameters
Services
--------
* **twig**: The ``Twig_Environment`` instance
, you will only
need to use this
.
* **twig**: The ``Twig_Environment`` instance
. The main way of
interacting with Twig
.
* **twig.configure**: Protected closure that takes the
t
wig
* **twig.configure**: Protected closure that takes the
T
wig
environment as an argument. You can use it to add more
custom globals.
* **twig.loader**: The loader for
t
wig templates which uses
* **twig.loader**: The loader for
T
wig templates which uses
the ``twig.path`` and the ``twig.templates`` options. You
can also replace the loader completely.
...
...
doc/internals.rst
View file @
5dcf618d
...
...
@@ -51,7 +51,7 @@ To solve this challenge we came up with a staging area
for routes. The ``ControllerCollection`` holds the
controllers until ``flush`` is called, at which point
the routes are added to the ``RouteCollection``. Also,
the controllers are frozen. This means that they can
the controllers are
then
frozen. This means that they can
no longer be modified and will throw an Exception if
you try to do so.
...
...
@@ -60,7 +60,7 @@ could be found, which is why flushing is now always
explicit. The Application will flush, but if you want
to read the ``ControllerCollection`` before the
request takes place, you will have to call flush
first
.
yourself
.
The ``Application`` provides a shortcut ``flush``
method for flushing the ``ControllerCollection``.
...
...
@@ -79,3 +79,6 @@ Following Symfony2 components are used by Silex:
* **Routing**: For matching defined routes.
* **EventDispatcher**: For hooking into the HttpKernel.
For more information, `check out the Symfony website
<http://symfony.com/>`_.
doc/services.rst
View file @
5dcf618d
...
...
@@ -97,8 +97,8 @@ Service definitions
Defining services is no different than defining parameters.
You just set an array key on the container to be a closure.
The difference is, when you retrieve the service, the
closure is executed.
This allows for lazy service creation.
However, when you retrieve the service, the closure is executed.
This allows for lazy service creation.
::
...
...
@@ -180,15 +180,16 @@ from being executed, by using the ``protect`` method.
Note that protected closures do not get access to
the container.
Predefined
services
-------------
------
Core
services
-------------
Silex defines a range of services which can be used
or replaced. You probably don't want to mess with most
of them.
* **request**: Contains the current request object,
which is an instance of ``Symfony\Component\HttpFoundation\Request``.
which is an instance of `Symfony\Component\HttpFoundation\Request
<http://api.symfony.com/2.0/Symfony/Component/HttpFoundation/Request.html>`_.
It gives you access to ``GET``, ``POST`` parameters
and lots more!
...
...
@@ -197,7 +198,8 @@ of them.
$id = $app['request']->get('id');
* **autoloader**: This service provides you with a
``Symfony\Component\ClassLoader\UniversalClassLoader``
`Symfony\Component\ClassLoader\UniversalClassLoader
<http://api.symfony.com/2.0/Symfony/Component/ClassLoader/UniversalClassLoader.html>`_
that is already registered. You can register prefixes
and namespaces on it.
...
...
@@ -205,7 +207,8 @@ of them.
$app['autoloader']->registerPrefix('Twig_', $app['twig.class_path']);
* **routes**: The ``Symfony\Component\Routing\RouteCollection``
* **routes**: The `Symfony\Component\Routing\RouteCollection
<http://api.symfony.com/2.0/Symfony/Component/Routing/RouteCollection.html>`_
that is used internally. You can add, modify, read
routes.
...
...
@@ -213,15 +216,18 @@ of them.
that is used internally. Check the *Internals*
chapter for more information.
* **dispatcher**: The ``Symfony\Component\EventDispatcher\EventDispatcher``
* **dispatcher**: The `Symfony\Component\EventDispatcher\EventDispatcher
<http://api.symfony.com/2.0/Symfony/Component/EventDispatcher/EventDispatcher.html>`_
that is used internally. It is the core of the Symfony2
system and is used quite a bit by Silex.
* **resolver**: The ``Symfony\Component\HttpKernel\Controller\ControllerResolver``
* **resolver**: The `Symfony\Component\HttpKernel\Controller\ControllerResolver
<http://api.symfony.com/2.0/Symfony/Component/HttpKernel/Controller/ControllerResolver.html>`_
that is used internally. It takes care of executing the
controller with the right arguments.
* **kernel**: The ``Symfony\Component\HttpKernel\HttpKernel``
* **kernel**: The `Symfony\Component\HttpKernel\HttpKernel
<http://api.symfony.com/2.0/Symfony/Component/HttpKernel/HttpKernel.html>`_
that is used internally. The HttpKernel is the heart of
Symfony2, it takes a Request as input and returns a
Response as output.
...
...
doc/usage.rst
View file @
5dcf618d
...
...
@@ -209,7 +209,7 @@ can also call ``match``, which will match all methods.
Route variables
~~~~~~~~~~~~~~~
As has been before you can define variable parts in a route like this::
As has been
show
before you can define variable parts in a route like this::
$app->get('/blog/show/{id}', function($id) {
...
...
...
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