January 10th, 2013, 11:45 PM
Learning Symfony 2
I am a new grad and recently got hired for my first job as a front end web developer for a large organization. I have finished most of the front end work and our team is now focused on the mid-tier and back-end work. I've been pulled in to help our mid-tier guy.
We are using Symfony 2 as our framework, and the mid-tier guys has already done alot of work on it. We have a working application, but we have a long ways to go before before it is complete. My problem here is understanding what is going on. The code is very complex as there are lots of components and bundles being added, and I have trouble tracking what is happening. I have read the Symfony book which helps me understand the basic concepts of how Symfony works, but does not help me understand how our framework works as it is very massive. Other then the Symfony book and asking the mid-tier engineers to explain their code, I am wondering if there is another resource that describes how large Symfony projects are integrated together.
A little bit about my skills:
Where will someone who has no experience with a framework go to understand a Symfony 2 massive website other then to the Symfony book and to talk to the engineers that wrote it. More specifically I want to learn how all the components interact with each other.
January 11th, 2013, 04:20 AM
ask your colleagues if they understand what you want to understand...I bet they don't know as much as you think they do.
Learn by example from the senior members of your team....how would they react if they saw your post here?
Last edited by ManiacDan; January 11th, 2013 at 08:28 AM.
Reason: spelling was killing me.
January 11th, 2013, 08:32 AM
For a second I thought you were the new guy at MY organization, but our app is done already.
Symfony is based on routes, but for some reason there's no central routing file. Every route for a bundle is in that bundle's routing file (or it's supposed to be, anyway).
If you want to trace the code for a specific page, grab the route from the URL. Grep the code for that route name. Find the routing file entry for that route. Look what controller/method the route applies to. Find that controller (should be in the same bundle as the route, but doesn't have to be). See which packages are imported at the top of the file, note them (or open them). Trace through the controller code and see what it does. If it uses ORM objects (which it will), note that it's probably instantiating the top level of a 3-level hierarchy of classes which contains business logic. The actual database columns and restrictions are usually in base classes. At the end of the controller method, a template is invoked. That should be in the resources folder of that package (but again, doesn't have to be). Go into it and check out the twig to see if anything else weird is happening.
HEY! YOU! Read the New User Guide and Forum Rules
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin
"The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002
Think we're being rude? Maybe you asked a bad question
or you're a Help Vampire.
Trying to argue intelligently? Please read this.