Silex (web framework)
Original author(s) | Fabien Potencier |
---|---|
Developer(s) | Silex contributors, SensioLabs |
Initial release | 16 September 2010 |
Stable release | 2.0.0[1] / 18 May 2016 |
Development status | Active |
Written in | PHP |
Operating system | Cross-platform |
Type | Web framework |
License | MIT License |
Website | <strong%20class= "error"><span%20class="scribunto-error"%20id="mw-scribunto-error-1">Lua%20error%20in%20Module:Wd%20at%20line%20405:%20invalid%20escape%20sequence%20near%20'"^'. http://<strong%20class="error"><span%20class="scribunto-error"%20id="mw-scribunto-error-1">Lua%20error%20in%20Module:Wd%20at%20line%20405:%20invalid%20escape%20sequence%20near%20'"^'.Lua error in Module:EditAtWikidata at line 29: attempt to index field 'wikibase' (a nil value). |
Silex is a micro web framework written in PHP and based on Symfony, Twig (template engine) and Doctrine (database abstraction). It is MIT Licensed.
The general purpose of Silex is to be as lightweight as you need it to be, as it is made for it to be as easy as possible to add features and extend the Silex base.[2] Silex can be used for the creation of small web applications (e.g. REST APIs) as this is the main case for micro frameworks,[3] however Silex can be extended into a full stack MVC framework.[4]
Silex comes in two available versions; 'fat' and 'slim'.[5] The difference between these being that the fat version is fully featured and includes database abstraction, a template engine and various Symfony components. Whereas the slim version just comes with a basic routing engine.
Features
The base feature set is a URL routing system, built-in Web Security, Sessions and Cookies abstraction. The extended version of Silex features integration of Twig, Doctrine, a Translation service for translating your application into different languages, a logging mechanism using the Monolog library to log requests and errors, services for form validation and generation, and more.[6]
History
Silex was originally created by Fabien Potencier, the creator of the Symfony framework, and Igor Wiedler.[7] It was first released 16 September 2010 as a 'web framework proof-of-concept'.[8]
Silex is now one of the best known micro frameworks for PHP[9] and is regularly placed among the fastest in benchmarks for micro framework comparisons.[10][11]
Example
The following code shows a simple web application that prints "Hello World!":
$app = new Silex\Application();
$app->get('/', function() use($app) {
return 'Hello World!';
});
$app->run();
See also
References
<templatestyles src="Reflist/styles.css" />
Cite error: Invalid <references>
tag; parameter "group" is allowed only.
<references />
, or <references group="..." />
External links
- No URL found. Please specify a URL here or add one to Wikidata.
- Silex Reference
- Introduction to Silex
- Silex Source Code
- Silex Cheatsheet
- Silex Community
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ http://silex.sensiolabs.org/download
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.