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
919c32c7
Commit
919c32c7
authored
Dec 24, 2013
by
WouterJ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some doc fixes
parent
7ae0fd8b
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
72 deletions
+82
-72
doc/intro.rst
doc/intro.rst
+16
-7
doc/usage.rst
doc/usage.rst
+66
-65
No files found.
doc/intro.rst
View file @
919c32c7
...
@@ -2,7 +2,7 @@ Introduction
...
@@ -2,7 +2,7 @@ Introduction
============
============
Silex is a PHP microframework for PHP 5.3. It is built on the shoulders of
Silex is a PHP microframework for PHP 5.3. It is built on the shoulders of
Symfony2 and Pimple and also inspired by
sinatra
.
Symfony2 and Pimple and also inspired by
Sinatra_
.
A microframework provides the guts for building simple single-file apps. Silex
A microframework provides the guts for building simple single-file apps. Silex
aims to be:
aims to be:
...
@@ -18,10 +18,12 @@ aims to be:
...
@@ -18,10 +18,12 @@ aims to be:
In a nutshell, you define controllers and map them to routes, all in one step.
In a nutshell, you define controllers and map them to routes, all in one step.
**Let's go!**::
Usage
-----
// web/index.
php
.. code-block::
php
// web/index.php
require_once __DIR__.'/../vendor/autoload.php';
require_once __DIR__.'/../vendor/autoload.php';
$app = new Silex\Application();
$app = new Silex\Application();
...
@@ -35,14 +37,21 @@ In a nutshell, you define controllers and map them to routes, all in one step.
...
@@ -35,14 +37,21 @@ In a nutshell, you define controllers and map them to routes, all in one step.
All that is needed to get access to the Framework is to include the
All that is needed to get access to the Framework is to include the
autoloader.
autoloader.
Next
we define a route to ``/hello/{name}`` that matches for ``GET`` requests
.
Next
a route for ``/hello/{name}`` that matches for ``GET`` requests is defined
.
When the route matches, the function is executed and the return value is sent
When the route matches, the function is executed and the return value is sent
back to the client.
back to the client.
Finally, the app is run. Visit ``/hello/world`` to see the result. It's really
Finally, the app is run. Visit ``/hello/world`` to see the result. It's really
that easy!
that easy!
Installing Silex is as easy as it can get. `Download`_ the archive file,
Installation
extract it, and you're done!
------------
Installing Silex is as easy as it can get. The recommend method is using
Composer_ and requiring `silex/silex`_. Another way is to `download`_ the
archive file and extract it.
.. _Download: http://silex.sensiolabs.org/download
.. _Sinatra: http://www.sinatrarb.com/
.. _Composer: http://getcomposer.org/
.. _`download`: http://silex.sensiolabs.org/download
.. _`silex/silex`: https://packagist.org/packages/silex/silex
doc/usage.rst
View file @
919c32c7
This diff is collapsed.
Click to expand it.
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