Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Silex (phpquebec)
Search
Igor Wiedler
July 12, 2013
Programming
6
440
Silex (phpquebec)
Igor Wiedler
July 12, 2013
Tweet
Share
More Decks by Igor Wiedler
See All by Igor Wiedler
Redis Bedtime Stories
igorw
1
260
Wide Event Analytics (LISA19)
igorw
4
900
a day in the life of a request
igorw
0
110
production: an owner's manual
igorw
0
140
The Power of 2
igorw
0
260
LISP 1.5 Programmer's Manual: A Dramatic Reading
igorw
0
380
The Moral Character of Software
igorw
1
250
interdisciplinary computing (domcode)
igorw
0
260
miniKanren (clojure berlin)
igorw
1
250
Other Decks in Programming
See All in Programming
苦しいTiDBへの移行を乗り越えて快適な運用を目指す
leveragestech
0
990
AIプログラミング雑キャッチアップ
yuheinakasaka
17
4k
How mixi2 Uses TiDB for SNS Scalability and Performance
kanmo
40
16k
Bedrock Agentsレスポンス解析によるAgentのOps
licux
3
910
Flutter × Firebase Genkit で加速する生成 AI アプリ開発
coborinai
0
170
密集、ドキュメントのコロケーション with AWS Lambda
satoshi256kbyte
1
210
.NET Frameworkでも汎用ホストが使いたい!
tomokusaba
0
190
ナレッジイネイブリングにAIを活用してみる ゆるSRE勉強会 #9
nealle
0
140
GoとPHPのインターフェイスの違い
shimabox
2
210
sappoRo.R #12 初心者セッション
kosugitti
0
270
SwiftUI Viewの責務分離
elmetal
PRO
2
270
Honoをフロントエンドで使う 3つのやり方
yusukebe
7
3.5k
Featured
See All Featured
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
A Tale of Four Properties
chriscoyier
158
23k
The Cost Of JavaScript in 2023
addyosmani
47
7.4k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
175
52k
The Language of Interfaces
destraynor
156
24k
Making the Leap to Tech Lead
cromwellryan
133
9.1k
4 Signs Your Business is Dying
shpigford
182
22k
A designer walks into a library…
pauljervisheath
205
24k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
6
570
For a Future-Friendly Web
brad_frost
176
9.6k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
Transcript
None
@igorwesome
Chunking
Context more abstract more concrete
Frameworks Zero
Frameworks Zero Don’t re- invent the wheel! You’re bloated and
buggy!
Frameworks Zero Conventions Libraries Wiring
Conventions Libraries Wiring Coding standard Directory layout Community
Conventions Libraries Wiring Routing ORM Templating etc.
Conventions Libraries Wiring Base config Library glue Bootstrap
Conventions Libraries Wiring Frameworks Zero
Conventions Libraries Wiring Frameworks Zero Because downloading stuff is hard!
None
Conventions Libraries Wiring
Conventions Libraries Wiring
Conventions Libraries Wiring Libraries Frameworks
Silex
Glorified Router
$app = new Silex\Application(); $app->get('/', function () { return "Hello
world!"; }); $app->run();
$app->get('/blog/{id}', 'Blog::showPost'); $app->post('/blog/{id}', 'Blog::createPost'); $app->put('/blog/{id}', function ($id) { ... })
->assert('id', '\d+');
$app->before(function () { ... }); $app->after(function () { ... });
$app->finish(function () { ... });
use Symfony\Component\HttpFoundation\Response; $app->error(function (\Exception $e, $code) { return new Response('Whoops!',
$code); });
$app->redirect('/hello'); $app->json($data); $app->sendFile($file);
Dependency Injection Container
class Application extends Pimple
$app['routes'] $app['url_matcher'] $app['kernel']
$app['routes']->add(...);
$app['debug'] = true;
$app['url_matcher'] = $app->share( function ($app) { return new MyUrlMatcher(); }
);
$app['foo'] = $app->share( function ($app) { return new Foo($app['bar']); }
);
$app['foo']
User Interface for Symfony2
http-kernel http-foundation event-dispatcher routing silex
REQ REP
None
silex app
silex app
diff -u symfony silex
--- symfony +++ silex @@ -1,3 +1 @@ -conventions -static
compilation -lots of services +choices
Glorified Router
Glorified Router Dependency Injection Container
Glorified Router Dependency Injection Container User Interface for Symfony2
Conventions Libraries Wiring Libraries Frameworks
Ω
Questions? @igorwesome silex.sensiolabs.org yolophp.com stackphp.com