A Year With Symfony

A Year With Symfony

Matthias Noback

Language: English

Pages: 141

ISBN: 9082120119

Format: PDF / Kindle (mobi) / ePub

A Year With Symfony

Matthias Noback

Language: English

Pages: 141

ISBN: 9082120119

Format: PDF / Kindle (mobi) / ePub


https://leanpub.com/a-year-with-symfony

ABOUT THE BOOK

I've written A Year With Symfony for you, a developer who will work with Symfony2 for more than a month (and probably more than a year). You may have started reading your way through the official documentation ("The Book"), the cookbook, some blogs, or an online tutorial. You know now how to create a Symfony2 application, with routing, controllers, entities or documents, Twig templates and maybe some unit tests. But after these basic steps, some concerns will raise about...

- The reusability of your code - How should you structure your code to make it reusable in a future project? Or even in the same project, but with a different view or in a console command?

- The quality of the internal API you have knowingly or unknowingly created - What can you do to ensure that your team members will understand your code, and will use it in the way it was meant to be used? How can you make your code flexible enough to be used in situations resembling the one you wrote it for?

- The level of security of your application - Symfony2 and Doctrine seem to automatically make you invulnerable for well-known attacks on your web application, like XSS, CSRF and SQL injection attacks. But can you completely rely on the framework? And what steps should you take to fix some of the remaining issues?

- The inner workings of Symfony2 - When you take one step further from creating just controllers and views, you will soon need to know more about the HttpKernel which is the heart of a Symfony2 application. How does it know what controller should be used, and which template? And how can you override any decision that's made while handling a request?

To get a better idea about the book, take a look at the table of contents below), or download a sample of the book above.

A printed edition of this book is available via Lulu.com.

ABOUT THE AUTHOR

Matthias Noback @matthiasnoback

My name is Matthias Noback. I am a PHP, Symfony2, object oriented programming, test-driven development enthousiast, living in Zeist with my girlfriend and son, who is jealous of me since I may look at a screen all day.

In previous years I've worked as software developer with a special attention to internal quality assurance. Now I'm a freelance developer, consultant and writer.

I regularly publish about some of the more advanced Symfony2-related topics on my blog php-and-symfony.matthiasnoback.nl.

Practical Cassandra: A Developer's Approach

Design Patterns in Ruby (Addison-Wesley Professional Ruby Series)

The Art of Readable Code

Beginning Kinect Programming with the Microsoft Kinect SDK

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

the service definition you can add a call to setLogger() with the logger service as an argument. When this service does not exist, you can indicate that it should be ignored (so that this dependency is truly optional): Service patterns 36 The argument of the call to setLogger() can be null (when the service is not

class="Matthias\AccountBundle\EventListener\SendConfirmationMailListener"> Event listener best practices An event listener should be named after the thing it does, not after the event it listens to. So instead of naming an event listener NewAccountEventListener, you should name it SendConfirmationMailListener. This also helps other developers when they are trying to find the place where a confirmation mail

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 183 183 184 186 186 186 186 CONTENTS 27 Reusable code should be easy to use . 27.1 Add documentation . . . . . . . . 27.2 Throw helpful exceptions . . . . . Use specific exception classes . . . Set detailed and friendly messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

extends \Twig_Extension { public function getFunctions() { return array( \Twig_SimpleFunction('important', function($thing) { ... }, array( 'is_safe' => array('html'), 'pre_escape' => 'html' ) ); } } Now all arguments provided to the function will first be escaped for the given context. Be wary of the raw filter You can override any auto-escaping functionality by ending an expression with the raw filter: {{ message|raw }} This would escape nothing, and when the message variable contains some

jms/metadata package¹ to you. It provides some good tools that help you combine configuration (or “metadata”) from different sources and store it as one object in a file cache. I’ve written a few articles on my blog about using this library to collect metadata using annotations², to add an alternative driver for collecting metadata³, and finally to cache the metadata properly⁴. In this chapter I choose not to discuss this subject in more detail, since the use of annotations for collecting

Download sample

Download