#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2006
    Posts
    7
    Rep Power
    0

    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:
    I only had a glimpse of frameworks in University. We only went over what a MVC is, and barely got through setting up a controller/route. I have taken introduction courses to ActionScript, Java, C++, and Python. Almost all of my programming experience has been in HTML, CSS, and JavaScript + jQuery. I am able to more or less read the PHP code, but understanding it is difficult as I get confused which component/element/class calls which one and the overall flow of the code.

    TL DR;
    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.
  2. #2
  3. Mad Scientist
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Oct 2007
    Location
    North Yorkshire, UK
    Posts
    3,661
    Rep Power
    4123
    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 07:28 AM. Reason: spelling was killing me.
    I said I didn't like ORM!!! <?php $this->model->update($this->request->resources[0])->set($this->request->getData())->getData('count'); ?>

    PDO vs mysql_* functions: Find a Migration Guide Here

    [ Xeneco - T'interweb Development ] - [ Are you a Help Vampire? ] - [ Read The manual! ] - [ W3 methods - GET, POST, etc ] - [ Web Design Hell ]
  4. #3
  5. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,866
    Rep Power
    6351
    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.

IMN logo majestic logo threadwatch logo seochat tools logo