News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Gonzalo Ayuso:
Bundles in Silex using Stack
July 17, 2013 @ 11:10:34

Gonzalo Ayuso has a recent post to his site showing you how to use Stack to create bundles for your Silex-based applications. Stack is a structure that allows for the reuse of HttpKernelInterface middleware to create a custom "stack" of functionality.

Nowadays almost every modern framework/applications implements HttpKernelInterface (Symfony, Laravel, Drupal, Silex, Yolo and even the framework that I'm working in ;) ) and we can build complex applications mixing different components and decorate our applications with an elegant syntax. The first thing than come to my mind after studying Stack is to join different Silex applications in a similar way than Symfony (the full stack framework) uses bundles.

In his example, he shows an example of a simple GET endpoint for a blog and API. In the first version, he calls the "run" method to execute the handling of the request. The second example, however, includes the attachment of a simple "MyKernel" middleware to the stack and calls "handle" to apply and send the modified Response back to the user.

0 comments voice your opinion now!
silex stack tutorial introduction middleware httpkernelinterface

Link: http://gonzalo123.com/2013/07/15/bundles-in-silex-using-stack

blog comments powered by Disqus

Similar Posts

WebReference.com: Unary, Binary, and Ternary Operators in PHP

Zend Developer Zone: Adding Multi-Language Support to Web Applications with PHP and PEAR

Andrea Giammarchi's Blog: PHP Serialization And Recursion Demystified

Chris Hartjes' Blog: Building a Gimmebar Sidebar

NetTuts.com: Unit Testing Succinctly: Why Unit Test?


Community Events

Don't see your event here?
Let us know!


framework podcast laravel interview series voicesoftheelephpant language unittest introduction extension conference library community development opinion release psr7 laravel5 api wordpress

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework