News Feed
Sections




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

Fabien Potencier's Blog:
Create your own framework... on top of the Symfony2 Components (part 7)
January 16, 2012 @ 08:46:22

Fabien Potencier has posted the seventh part of his series looking at how to make a custom framework on top of the components from the Symfony2 framework. In this part of the series he improves his basic framework by adding some namespacing to organize the application a bit more.

If you have a closer look at the code, front.php has one input, the Request, and one output, the Response. Our framework class will follow this simple principle: the logic is about creating the Response associated with a Request. As the Symfony2 components requires PHP 5.3, let's create our very own namespace for our framework: Simplex.

He puts the main front controller in just the "Simplex" namespace but adds in others for the controllers and models. He also updates his Composer configuration to create some PSR-0 autoloading.

0 comments voice your opinion now!
symfony2 components framework custom tutorial series namespace autoload


blog comments powered by Disqus

Similar Posts

PHPBuilder.com: BitMasks: Emulate Unix Permissions in PHP (Quickly)

CodeIgniter Blog: CodeIgniter 1.7.1 Released

Chris Hartjes' Blog: My Next Foolish Project: A console for CakePHP

David Coallier's Blog: Namespaces has PHP 5.3 (Or the other way around)

Jonathan Snook's Blog: View Caching in CakePHP 1.1.8


Community Events





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


community install podcast language symfony2 series release opinion api list framework code refactor developer laravel threedevsandamaybe interview testing unittest introduction

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