Tag: forms
-
Symfony 2: Annoying Issue with Data Transformers, DateTime, Timezones and PHP.ini
I spent almost the entire day going through the low level code of Symfony 2 trying to determine a really obscure error with my code. The issue started from dealing with using a Time type for one of my columns and having the form validate it appropriately. Unfortunately, the error message that bubbled up did…
-
Symfony 2: Many-to-Many Relationships and Form Elements
One of the things I’m developing a love for with Symfony 2 is how Doctrine, forms and Twig work together in a fairly elegant manner. With a little bit of code and annotations, you can allow Symfony 2 to perform a lot of the heavy lifting and boiler plate code that normally is a pain-in-the-rear…
-
Symfony 2: Working with the Security Layer and Database Backends
The examples over on the Symfony 2 site regarding building a security system, while decent, are somewhat incomplete and a little confusing, especially in putting all the details together for a database backed login system. While most of the code present on the two articles work for the most part, I wanted to add a…
-
Symfony 2: Form Data Submit and Models with Validation Unit Testing Issue
While creating a phpunit test against a form for Symfony 2, I encountered an interesting problem that made little sense to me at first (for reference, I was following an example for unit testing form types from the Symfony 2 website). The problem was that the data being submitted appeared to not be mapped correctly,…
-
Symfony 2: Adding A Selection List of Entities
The examples from the documentation on the Symfony 2 site did not explain how one could render a list of entities in the form of say a select html drop down for an object that has a one-to-many type of relationship (the sample showed a product to category relationship). Instead, what was shown was embedding…
-
Symfony 2: Day 3 Test Drive
I created a new bundle for my application and am attempting to move towards a more serious mode of programming. Rather than working with your typical “Hello Worlds”, I decided to focus on a more complex test case that’ll help motivate me in getting a better feel for more advanced features.