If you want to get the value of the selected element of a radio group, prototype makes this easy. There is more than one way to do it. I’ll update this post as better methods surface. Check out code after the jump.
June 5, 2008 – 12:50pm Get value of radio button group using prototype
February 29, 2008 – 1:45pm Propel Transactions with Symfony
It’s easy to create transactions with Propel. This can be very useful when you are deleting rows from your database from multiple tables, and want to do an “all or nothing” approach so that things don’t get messy. More…
February 9, 2008 – 5:02pm Using svnX with svn+ssh on a non-standard port
svnX is a great mac GUI for svn repositories. A lot of our svn servers are accessed via non-standard ports for security, and a limitation of the svn+ssh syntax is that you can’t specify a non-standard port in the address name. To get around this in the command line, you can set a local environment variable “SVN_SSH” like so: More…
January 24, 2008 – 4:48pm Propel Criteria Left Join: using addJoin() and addAlias() to join a table twice
Here is a way to do left join on two columns in a table that both were foreign keys in the same table using Propel. This might happen if for example you have a table with a parent_id and a child_id in a nested set that both refer to the same table, or as an example you have a table “documentation” and each documentation can be categorized into a main category and a sub category.
What happens when you want to do a left join in your documentation query, so that if present both the related category and sub_category objects get included in the results?
$c->addJoin(DocumentationPeer::CATEGORY, CategoryPeer::ID, Criteria::LEFT_JOIN);
$c->addJoin(DocumentationPeer::SUB_CATEGORY, CategoryPeer::alias('c2', CategoryPeer::ID), Criteria::LEFT_JOIN);
$c->addAlias('c2', CategoryPeer::TABLE_NAME);
Done and done!
January 24, 2008 – 4:37pm Installing Symfony on Leopard
I’ve found the best way to install symfony on Leopard is to use the version from SVN. I find this is easy to do, and easy to update in the future. Here is a cheat sheet for those looking to get up and running with symfony on their Mac running 10.5 Leopard. More…
January 21, 2008 – 9:50am svn, apache2, os x leopard 10.5
Mac OS 10.5 Leopard ships with Apache2 and SVN. However, if you want to keep a local svn repository and not use an external svn server (only really useful if you have projects which you will be the only developer), you have to set up the repository yourself. Here is a quick cheat-sheet to help you do just that. More…
January 14, 2008 – 2:55pm symfony propel-load-data
Loading data from fixtures can be extremely useful to pre-populate your database so you have something to test and code with. I frequently use the propel-load-data task in two ways, the first when altering the schema, and the second to add some new data on top of whats in the database.
This will rebuild your db and model from schema.yml, insert the new structure into your db, and load data from the fixtures in /data/fixtures:
./symfony propel-build-all-load frontend
To load in additional data from a specific fixture file, you can use this command:
./symfony propel-load-data frontend dev data/fixtures/[filename].yml append
January 11, 2008 – 7:04pm Resize a Boot Camp Partition for Use with VMware Fusion
I’m sure this happened to a lot of us, but I started out with my Windows Boot Camp partition about 5GB. My only intention was to use it to test out our web sites in multiple windows browsers. However, after installing all of the Windows XP updates, service packs, VMware tools, multiple IEs, and Firefox, I only had about 400 MB of free space available. I finally hit the tipping point where to install new software (SPSS) I would need more space. No way did I want to go through starting from scratch. Downloading all of those windows updates took FOREVER. So, here is how I managed to resize the Boot Camp partition and still get it to work in Fusion. These steps were performed on a MacBook Pro running Leopard and a Windows XP Boot Camp partition formatted as FAT32. More…
December 13, 2007 – 12:54am Propel Set Distinct: setDistinct()
Propel’s use of the Criteria class has many unknown features documented deep within the propel API. One of my favorites is setDistinct(), which will add the DISTINCT keyword into the start of your query. This is very useful when you want to create a select menu that presents a list of pre-existing values for a column in your database. More…
November 16, 2007 – 4:57pm Sending Email within Symfony
Symfony allows you to dish off the responsibility of sending an email to another module/action when necessary, which can be great because it can utilize the “view” aspect of the framework so you can store your email formatting (plain text or HTML) as a template just like you would for a regular action.
As I don’t use this functionality that often, I usually forget how to pass parameters over to this other mail action, such as the id of the object I am working with or the recipient’s email address.
Sending Email with a Custom Action
In this example we’ll be sending an lease application notice to the manager of a property. After the application is saved, we want to send an email to the property manager containing the property name and applicant name, and include a link for them to login and view the complete application.
In our “save” action of the “leaseApp” module, right after the application is saved we’ll send off the email, and we can do this (as outlined in the symfony cookbook) by delegating to another action. More…



