Radiobutton issues while migrating from cakePHP-1.2alpha app to 1.2prebeta

Today a new version of cakephp-1.2′s pre-beta released, Eager to upgrade I plugged it into the new Cheesecake2 codebase which was happily on cakephp-1.2′s last alpha (released on 9th July).

As expected some minor migration issues did crop up immediately, posting the list below

1. No more debug, cake_admin etc. constants in config/core.php
- Replace the old core.php with the new one and then make changes in it as per your needs – debug setting, admin routing etc.

That was easy what took a bit more time was the new things in the radiobutton output by the form helper.

2. Addition of fieldset/legend around radio buttons
- You need to set

  1. 'legend' => false

in options of radio field if you don’t need a fieldset around your radio buttons

3. Label given for radio buttons group does not appear but radio buttons texts appear as labels
- If you have given a label to your radio buttons group then it will not appear at all, rather but your radio button options will be made labels. If you need to provide a single label for radio buttons group then you have to explicitly put

  1. $form->label()

before (or after or above or bottom – as per your need,)

  1. $form->radio()

. Also if you don’t need your radio button options to appear as labels then set

  1. 'label' => false

4. The ‘inbetween’ has been removed
- If you need to separate your radio button using any string, e.g.:-
(line break), then you need to use

  1. 'separator' => '<br />'

instead of

  1. 'inbetween' => '<br />'

I am sure the above will help prevent some hair-pulling by people less keen on diving into the source ;)

But that said – the new features which have been put in seem to be really awesome as usual

About Amit Badkas

Amit Badkas is Zend certified PHP5 and Zend Framework engineer, and has been working in SANIsoft for past 10 years, his present designation is 'Technical Manager'

6 Responses to Radiobutton issues while migrating from cakePHP-1.2alpha app to 1.2prebeta

  1. Daniel Hofstetter October 24, 2007 at 2:48 pm #

    Thanks for the hint, saved me quite some time ;-)

  2. snowdog November 20, 2007 at 8:58 am #

    Thanks, it saved me some time of digging in the form helper code

  3. sk8te December 30, 2008 at 4:17 pm #

    Thx a lot…..You are grt!!!!!!

Trackbacks/Pingbacks

  1. cakebaker » Upgrading to CakePHP 1.2 pre-beta - October 24, 2007

    [...] likely is an issue with radio buttons, which has been described (with solution) by Amit [...]

  2. developercast.com » Sanisoft Blog: Radio button issues while migrating from cakePHP-1.2alpha app to 1.2prebeta - November 2, 2007

    [...] the Sanisoft blog , Amit Badkas has posted a few fixes that he found when he was trying to make the upgrade from CakePHP 1.2 alpha to the 1.2 prebeta [...]

  3. 1.1 hay 1.2? :: {one true brace - November 2, 2007

    [...] #3 [02.11.07]: Thêm một bài viết khác về vấn đề nâng cấp lên Cake 1.2 pre-beta: Radiobutton issues while migrating from cakePHP-1.2alpha app to 1.2prebeta của Amit Badkas. Ngày 30.08.07 | Phân mục [...]

Leave a Reply