Tag Archives: Symfony

symfony adding file image constraints to form

let’s say you want to constraint what people are uploading and you don’t want to use assert statements in the entity. you can do it in the formbuilder

doctrine owning side and inverse side

owning and inverse side can be confusing. Then there is uni and bi directional relationships. For example: These are some key rules: * The owning side has to use the inversedBy attribute of the OneToOne, ManyToOne, or ManyToMany mapping declaration. The inversedBy attribute contains the name of the association-field on the inverse-side. * The inverse … Continue reading

Form by_reference = true

if you are extending an entity, most of the time, you can ignore the by_reference field option. This is because it is set to true by default and its usually what you want. for example This form field uses the variable “owner” as defined in the user class. it will call setOwner in the user … Continue reading

Regnerating bootstrap cache in symfony 2

if you accidentally delete the bootstrap cache ./vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php

Symfony: find all default global variables in twig

Twig ships with some default global variables that you can use. Where does this variables come from? You will see a Globals section. Take the ‘app’ variable for example, you can find all the variables available in that file. That is why {{ app.user }} works. To see all the variables in app.user, {{ dump(app.user) … Continue reading

Software developer survival skills

To have a career as a developer, you need to have some important basic skill sets. All (new) technologies are built on top or around some commonly used technologies. People always say, “WOW, this technology is really hot now, you should learn it!”. Yes, but to even know the basics, it will take years to … Continue reading

Why Symfony?

Choosing the best framework for rapid development has been a topic that has been debated to death. Today, there is no longer “the best framework” because all modern day framework is scalable and robust, they learn from each other. They are all adapting very fast to new techniques of doing things. At the time of … Continue reading

Symfony2: Installation

The official installation doc is http://symfony.com/doc/current/book/installation.html. As a best practice, don’t install symfony in MAC or Windows, install in Linux and use Linux for development because you will be using Linux for hosting. For consistency in development, develop in virtual machine. The spec of the virtual machine should be the same as the production server. … Continue reading