Category Archives: 1.4

Changing Symfony Routing Requirements

One of my favorite features of Symfony is the routing sub-system.  It allows for very flexible routing rules.  On a project I have been working on, I have been tweaking the routing requirements in Symfony.  One really nice feature is … Continue reading

Posted in 1.4, PHP, Symfony | Tagged , , , , , , | Leave a comment

Symfony including extra libraries or classes

I had a need lately to include an external library of php classes in a Symfony project. On option was dumping them into the lib folder, but I didn’t want to do that. At first I tried placing a script … Continue reading

Posted in 1.4, PHP, Symfony | Tagged , , , , | 1 Comment

Doctrine Query Foreach Problem

The other day I was trying foreach loop through a Doctrine collection. I was getting confused, because my loop was never executing even though count() returned a positive value. It turns out that I had forgotten to run ->execute() on … Continue reading

Posted in 1.4, Doctrine, PHP, Symfony | Tagged , | Leave a comment

Symfony override getter

Similar to overriding setters, overriding getters in symfony has a strange syntax. Rather than doing the normal override code you must use special methods. This code will NOT work consistently: However, this code will work: Although the first code will … Continue reading

Posted in 1.4, Symfony | Tagged , , , , | 1 Comment

Allowing Slashes in a Symfony Route

Symfony routing is a wonderful tool. Recently, however, I have wanted to include a slash in a route parameter. This can seem problematic as symfony uses slashes to delimit parameters. For example, lets say I wanted the url http://www.example.com/user/john/jacob/jingleheimer/schmidt to … Continue reading

Posted in 1.4, Symfony | Tagged , , , , | 1 Comment

Symfony Framework for PHP

Our Company has been in the process of evaluating the Symfony Framework for PHP. We have written several projects using the framework some small and some larger. In this post I intend to layout some of pluses and drawbacks of … Continue reading

Posted in 1.4, PHP, Symfony | Tagged , , | 4 Comments

Clearing Symfony Cache for a Single Page

Symfony cache is a useful part of the Symfony Framework. It allows you to cache pages, partials, and other sections of pages so that the page is only generated when necessary. However, if you make heavy use of it, you … Continue reading

Posted in 1.4, PHP, Symfony | Tagged , , | Leave a comment

Doctrine Wherein with Empty Array

Today I was working with some doctrine code and was running into a strange bug. I was running a query that should have returned no objects, but instead returned all objects from a table. It turns out it was due … Continue reading

Posted in 1.4, Doctrine, Symfony | Tagged , , , , , | Leave a comment

Making Symfony Routes Available in Tasks

By default symfony puts the routing.yml file in an application’s config folder.  This is nice if you wish to have separate routing for separate apps.  However, if you only have one app, it greatly simplifies things to place this file … Continue reading

Posted in 1.4, Symfony | Tagged , , , , | Leave a comment

Symfony Doctrine “where in” and “where not in” Syntax

When you’re utilizing Doctrine to search a database for a value not present in a given set, it might be tempting to use some sloppy code like the following: While code like this can work, it’s difficult to read and … Continue reading

Posted in 1.4, Symfony, Uncategorized | 3 Comments