I didn’t want to spend my summer programming in my free time, so I didn’t. There were a few sunday mornings where I poked around with Symfony2 over a cup of coffee, but I wasn’t quite determined to build an application with it. I’ve been planning to build something with Symfony2 for some time, and now I am.
First off – I’m experienced with ZendFramework and ORM’s. I’ve done a lot with ZendFramework, and I’m very comfortable with it. I’m aware of some major differences between ZendFramework and Symfony2. If you do a little research, you’ll find what I’m referring to.
Anyways, I’ve spent the better part of the last few days with Symfony2, and here are a few things that stood out right away:
- clearing cache with the console tool: I ended up using `sudo rm -rf app/cache/*` because permissions are a mixture of being owned by Apache and my development username. The tool needs to create folders: prod, prod_old, prod_new, dev, dev_old, .. What is the correct way to do it??!! I don’t know.. and I wasn’t able to find any search results that provide a good example of how to deal with this. The console tool was not working as intended. In some cases I was able to clear the cache with the console tool, after running it 3 times.
- creating model entities with relationships: for example, try creating entities ‘post’ and ‘category’, where ‘category’ is a parent to ‘post’. This task should be simple for someone who knows exactly what to do. Sure, practice makes perfect.. I’ve done this many times using ZendFramework and an ORM, but it took some tinkering here. What is the correct order to modify entities? I’m using yaml-based schema files rather than annotations in my Entity classes.. I ended up editing my Entity/Model files before the Symfony console would accept my schema file changes. It seems I have a little more to learn here, but the console tool did not do what I was expecting. I was expecting something similar to generating and re-generating model classes with Propel 1.6, where you basically just edit the schema, then run a command from console, and it doesn’t ‘complain’.
- Generating crud from the console tool frequently errored out when creating routes. This is the last step of the multi-step dialog in the console tool, when creating crud based on an entity. Generating entities seems to recognize pre-existing functions, so I wonder why it cannot recognize pre-existing routes, and append new routes.
- I ended up adding __toString() to my entity classes, after some research; in order for my forms to render. It’d be nice if Symfony2 left a comment or something somewhere that brought attention to the need for this.
- It’d be nice if Symfony had an in-depth tutorial/walk-through that included some variety between parent/child relationships and integer/string keys in the database.
I’m still very interested in learning about Symfony2 development, including the ‘gotchas’. I’m just a little surprised at this point, that some aspects are not as simple or easy-going as I’ve experienced with ZendFramework and Propel 1.6.
