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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Igor Wiedler
July 12, 2013
Programming
450
6
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Silex (phpquebec)
Igor Wiedler
July 12, 2013
More Decks by Igor Wiedler
See All by Igor Wiedler
Redis Bedtime Stories
igorw
1
360
Wide Event Analytics (LISA19)
igorw
4
950
a day in the life of a request
igorw
0
170
production: an owner's manual
igorw
0
200
The Power of 2
igorw
0
340
LISP 1.5 Programmer's Manual: A Dramatic Reading
igorw
0
490
The Moral Character of Software
igorw
1
320
interdisciplinary computing (domcode)
igorw
0
320
miniKanren (clojure berlin)
igorw
1
330
Other Decks in Programming
See All in Programming
Go言語とトイモデルで学ぶTransformerの気持ち / fukuokago23-transformer
monochromegane
0
140
ソフトウェア設計に溶けるインフラ ― AWS CDK のインフラ認識論
konokenj
2
640
ここ半年くらいでAIに作らせたR用ツール
eitsupi
0
230
ルールを書いて終わらせないハーネスエンジニアリング
yug1224
4
1.7k
Lean は証明の正しさを確認するためだけのツールって思ってませんか?
inoueasei
1
110
【やさしく解説 設計編 #1】「ドメイン駆動」と「実装駆動」ってなに? 〜設計の考え方を、たとえ話で学ぼう〜
panda728
PRO
1
130
琵琶湖の水は止められてもNet--HTTPのリトライは止められない / You might be able to stop the water flow of Lake Biwa but you can't stop Net::HTTP retries
luccafort
PRO
0
440
数百円から始めるRuby電子工作
tarosay
0
100
吝嗇家のためのAI活用 / AI development for miser - ChatGPT + Issue Driven Development
tooppoo
0
200
共通化で考えるべきは、実装より公開する型だった
codeegg
0
280
鹿野さんに聞く!『TypeScriptコードレシピ集』で磨く実践力
tonkotsuboy_com
4
1.2k
【やさしく解説 設計編 #0】DDDのコード、読めるのに分からない人へ
panda728
PRO
2
280
Featured
See All Featured
Deep Space Network (abreviated)
tonyrice
0
230
Being A Developer After 40
akosma
91
590k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
Making the Leap to Tech Lead
cromwellryan
135
10k
What does AI have to do with Human Rights?
axbom
PRO
1
2.3k
Thoughts on Productivity
jonyablonski
76
5.3k
Embracing the Ebb and Flow
colly
88
5.1k
How Software Deployment tools have changed in the past 20 years
geshan
0
34k
Scaling GitHub
holman
464
140k
Rails Girls Zürich Keynote
gr2m
96
14k
The browser strikes back
jonoalderson
0
1.4k
So, you think you're a good person
axbom
PRO
2
2.1k
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