Link
Embed
Share
Beginning
This slide
Copy link URL
Copy link URL
Copy iframe embed code
Copy iframe embed code
Copy javascript embed code
Copy javascript embed code
Share
Tweet
Share
Tweet
Slide 1
Slide 1 text
No content
Slide 2
Slide 2 text
@igorwesome
Slide 3
Slide 3 text
Chunking
Slide 4
Slide 4 text
Context more abstract more concrete
Slide 5
Slide 5 text
Frameworks Zero
Slide 6
Slide 6 text
Frameworks Zero Don’t re- invent the wheel! You’re bloated and buggy!
Slide 7
Slide 7 text
Frameworks Zero Conventions Libraries Wiring
Slide 8
Slide 8 text
Conventions Libraries Wiring Coding standard Directory layout Community
Slide 9
Slide 9 text
Conventions Libraries Wiring Routing ORM Templating etc.
Slide 10
Slide 10 text
Conventions Libraries Wiring Base config Library glue Bootstrap
Slide 11
Slide 11 text
Conventions Libraries Wiring Frameworks Zero
Slide 12
Slide 12 text
Conventions Libraries Wiring Frameworks Zero Because downloading stuff is hard!
Slide 13
Slide 13 text
No content
Slide 14
Slide 14 text
Conventions Libraries Wiring
Slide 15
Slide 15 text
Conventions Libraries Wiring
Slide 16
Slide 16 text
Conventions Libraries Wiring Libraries Frameworks
Slide 17
Slide 17 text
Silex
Slide 18
Slide 18 text
Glorified Router
Slide 19
Slide 19 text
$app = new Silex\Application(); $app->get('/', function () { return "Hello world!"; }); $app->run();
Slide 20
Slide 20 text
$app->get('/blog/{id}', 'Blog::showPost'); $app->post('/blog/{id}', 'Blog::createPost'); $app->put('/blog/{id}', function ($id) { ... }) ->assert('id', '\d+');
Slide 21
Slide 21 text
$app->before(function () { ... }); $app->after(function () { ... }); $app->finish(function () { ... });
Slide 22
Slide 22 text
use Symfony\Component\HttpFoundation\Response; $app->error(function (\Exception $e, $code) { return new Response('Whoops!', $code); });
Slide 23
Slide 23 text
$app->redirect('/hello'); $app->json($data); $app->sendFile($file);
Slide 24
Slide 24 text
Dependency Injection Container
Slide 25
Slide 25 text
class Application extends Pimple
Slide 26
Slide 26 text
$app['routes'] $app['url_matcher'] $app['kernel']
Slide 27
Slide 27 text
$app['routes']->add(...);
Slide 28
Slide 28 text
$app['debug'] = true;
Slide 29
Slide 29 text
$app['url_matcher'] = $app->share( function ($app) { return new MyUrlMatcher(); } );
Slide 30
Slide 30 text
$app['foo'] = $app->share( function ($app) { return new Foo($app['bar']); } );
Slide 31
Slide 31 text
$app['foo']
Slide 32
Slide 32 text
User Interface for Symfony2
Slide 33
Slide 33 text
http-kernel http-foundation event-dispatcher routing silex
Slide 34
Slide 34 text
REQ REP
Slide 35
Slide 35 text
No content
Slide 36
Slide 36 text
silex app
Slide 37
Slide 37 text
silex app
Slide 38
Slide 38 text
diff -u symfony silex
Slide 39
Slide 39 text
--- symfony +++ silex @@ -1,3 +1 @@ -conventions -static compilation -lots of services +choices
Slide 40
Slide 40 text
Glorified Router
Slide 41
Slide 41 text
Glorified Router Dependency Injection Container
Slide 42
Slide 42 text
Glorified Router Dependency Injection Container User Interface for Symfony2
Slide 43
Slide 43 text
Conventions Libraries Wiring Libraries Frameworks
Slide 44
Slide 44 text
Ω
Slide 45
Slide 45 text
Questions? @igorwesome silex.sensiolabs.org yolophp.com stackphp.com