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
250
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
CSS Linter による Baseline サポートの仕組み
ryo_manba
1
140
Lottieアニメーションをカスタマイズしてみた
tahia910
0
130
一休.com のログイン体験を支える技術 〜Web Components x Vue.js 活用事例と最適化について〜
atsumim
0
680
苦しいTiDBへの移行を乗り越えて快適な運用を目指す
leveragestech
0
810
Multi Step Form, Decentralized Autonomous Organization
pumpkiinbell
1
810
color-scheme: light dark; を完全に理解する
uhyo
6
460
責務と認知負荷を整える! 抽象レベルを意識した関心の分離
yahiru
8
1.2k
Visual StudioのGitHub Copilotでいろいろやってみる
tomokusaba
1
180
Djangoアプリケーション 運用のリアル 〜問題発生から可視化、最適化への道〜 #pyconshizu
kashewnuts
1
250
Pulsar2 を雰囲気で使ってみよう
anoken
0
240
Introduction to kotlinx.rpc
arawn
0
740
WebDriver BiDiとは何なのか
yotahada3
1
150
Featured
See All Featured
What's in a price? How to price your products and services
michaelherold
244
12k
Speed Design
sergeychernyshev
27
800
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.6k
Code Review Best Practice
trishagee
67
18k
How to train your dragon (web standard)
notwaldorf
91
5.8k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
7k
Building Flexible Design Systems
yeseniaperezcruz
328
38k
Embracing the Ebb and Flow
colly
84
4.6k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
160
15k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7.1k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
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