CakePHP radio button example

cakephp radio buttons.png
Thanks Ronnie, for the example! It looks like this useful hint won’t appear in the cakephp documentation any time soon. I think is’t “nerdnoteworthy”:

echo $html->radio(
	'User/admin',
	array(
		'no' => 'No',
		'yes' => 'Yes'),
	null,
	array('value' => 'no')
);

8 Responses to “CakePHP radio button example”

  1. Abba Bryant says:

    Wow, way to use an example months old from an almost year old ticket posted for a version of cake that is out of date and no longer intended for use.

    A 1.2 example is:

    echo $form->input( 'User.admin',
    'type' => 'radio',
    'options' => array( 'Yes'=>'yes', 'No'=>'no' )
    ));

  2. plumpnation says:

    Er, Abba, did you check the date on this post. No. You didn’t. Did you.

  3. Slovinco says:

    I think he didn’t. Did he?

  4. I_am_me says:

    No he didn’t. Did he?

  5. Sean says:

    I don’t know. Did he?

  6. Filipe says:

    He didn’t. Did I?

  7. lusi says:

    u guys are funny…and yes, he didn’t check the date. so do I, did you ?

Leave a Reply