Jump to ratings and reviews
Rate this book

Extending Symfony2 Web Application Framework

Rate this book
Optimize, audit, and customize web applications with Symfony If you have a good understanding of how Symfony works and are now trying to integrate complex tasks in your application, or want to better organize your application by keeping each piece of code where it belongs so it can be decoupled and easily used elsewhere, then this book is for you. Symfony is a high performance PHP framework for developing MVC web applications. Symfony1 allowed for ease of use but its shortcoming was the difficulty of extending it. However, this difficulty has now been eradicated by the more powerful and extensible Symfony2. Information on more advanced techniques for extending Symfony can be difficult to find, so you need one resource that contains the advanced features in a way you can understand. This tutorial offers solutions to all your Symfony extension problems. You will get to grips with all the extension points that Symfony, Twig, and Doctrine offer and understand how each of them can be specifically leveraged to achieve cleaner, better structured, and re-usable code for your application. Beginning with the core concepts of Services and Listeners, you quickly move on to learn the complexity of forms, creating commands, and implementing security, and finally you will share these extensions with others. This book will tell you everything you need to know to regain control of your code, to keep things simple, and share it within your application(s) or even the world. Whether you have already written extensions for Symfony2 or not, this book will be a useful guide through all possible types of extensions, and how each of them can be implemented and leveraged in your own applications.

140 pages, Paperback

First published February 18, 2014

12 people want to read

About the author

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
2 (18%)
4 stars
3 (27%)
3 stars
5 (45%)
2 stars
1 (9%)
1 star
0 (0%)
Displaying 1 - 4 of 4 reviews
Profile Image for Michael Sypes.
220 reviews1 follower
May 13, 2017
Lots of good material, but the writing is oftentimes confusing, jumping into things with poor background, especially at the beginning. Unfortunately, with the pace of technology, there's a fair amount that's also outdated already, but nevertheless, worth the read.
Profile Image for Seval U..
1 review1 follower
May 19, 2014
I am a PHP developer for 4 years. I used a few frameworks of PHP and I created my own MVC framework too. However Symfony2 is the best framework I've ever used. I got the book "Extending Symfony2 Web Application Framework" which is written by Sébastien Armand. The first release of the book is in March 2014, so it is the latest published book about Symfony2 framework (PHP).

This book addresses the developers who already know Symfony2 and PHP5 because it helps you to understand the subject deeply. The books offers features for Symfony2.3 or higher and for PHP5.4 and higher. Examples in the book are based on MongoDB but you can convert it to MySQL and PostgreSQL.

It starts to telling about Services and Listeners which are very importand in Symfony2. As a PHP developer, I didn't know services and listeners that much until I read the book. There is a GEO location example. It shows codes and defines classes. If you want to extend the framework, you should know how to create a class and put it in the service and how to create a listener.

After these concepts, the book continues with commands and templates. It shows how to create a command for resizing user images step by step. For extending templates, it extends Twig which is the flexible, fast, and secure template language for PHP. You can create your own custom Twig tags or your own function by extending Twig. Most of developers who use Symfony2 do not extend Twig or they don't know how to do it. You can learn it in an example in this book, however it shows just one form of extending the template. There are a lot of way to extend the template.

In third chapter, there are useful tips about forms in Symfony2. This part is very comprehensive. In fourth chapter, it shows security tips by giving an example of "Simple OAuth with GitHub". I have been already using Firewall structure for Symfony2 but there are more advanced security options in the book.

Lastly "Extending Symfony2 Web Application Framework" gives examples on doctrine. Doctrine has Object Relational Mapper (ORM) for PHP that sits on top of a powerful database abstraction layer (DBAL). In the book, there are methods to extend doctrine and entities.

With all this, you will be fully equipped to create any type of extension in Symfony. In the last chapter, it shows how to reuse and share your custom extensions. The examples in the book are sufficient to learn. I benefitted from this book very much. I really recommend book of "Extending Symfony2 Web Application Framework" to people wanting to learn and use Symfony2 deeply in their projects.
Profile Image for Maksim.
1 review2 followers
May 11, 2014
I think that Symfony 2 is the most popular PHP framework nowadays. That’s why it seems very strange to me that there are no books on this technology.
Of course online documentation is just fantastic. It is an example of excellent up-to-date documentation developed by community. But even taking that into account it’s still strange that no books were published. Till today.
Today I’ve read a book “Extending Symfony2 Web Application Framework” written by Sébastien Armand and published by Packt Publishing.
Book is rather thin (140 pages), so I didn’t expect a deep manual covering all the functionality.

This book is definitely not for a beginner. It is not a manual. It does not cover Symfony concepts. In fact it is build as a cookbook. Very similar to the Cookbook on Symfony website. But unlike that official Cookbook it uses one real-world project to show concepts from all the chapters.
Like a cookbook it does not contain a deep explanation of how all features work under the hood, but rather concentrates on how to use all of them. In most cases this approach is great, but I personally would highlight some edge cases (like DI container performance and ways to improve it).
It’s great that this book concentrates just on few components but describes them in details instead of high-level explanation of each and every component.
Structure of the book seems strange to me. I have no idea why Services & Listeners, Commands & Templates are described together in the same sections.

Summarizing, it is an interesting book for a developer with a real-world Symfony 2 experience, but not for beginners. Book covers few components and libraries, but it contains a lot of interesting ideas and use cases.
Thanks to Sébastien and waiting for the second part covering remaining widely used components (Validation, Routing, Translation etc.)!
Profile Image for Tobias.
56 reviews
April 23, 2014
This book is definitely not for newcomers to Symfony2, which it also says in its introduction and online description. Knowing that and reading it as an experienced Symfony developer, I'm sure you'll pick up a new trick or two — I know I did!

In Extending Symfony2, Sébastien goes through building an imaginary website for organizing meetups, as an example to learn how to wield the more advanced parts of Symfony2's massive toolbox. It's a well thought out example which fits with the iteratively process of the six different chapters.

There is a lot of goodies in the book and it goes into the many nitty gritty details. Despite this I can't help but feel there's quite a few gaps, where I would have loved to read more about the reason for doing things a certain way or have something more thoroughly explained.

Most of the examples of the book are very good and instructional, each example building upon the previous. Others are less so and I think the book could have benefited a lot from a pair more pedagogic eyes in its review process. To be honest it feels a bit rushed and I would have loved to see what Sébastien could have accomplished with a bit more time.

All in all though, this is a good book with a lot of juicy information. I would recommend it to anyone who wants to sharpen their already existing Symfony2 skills.
Displaying 1 - 4 of 4 reviews

Can't find what you're looking for?

Get help and learn more about the design.