Re: Quick way to wrap input[type=radio] in label tags?

2013-06-18 Thread OJ Tibi - @ojtibi
Thanks, I probably have to subclass the FormHelper, as hiromi pointed out 
in an earlier reply, since the 's "for" attribute is kinda required, 
and the radio button IDs need to be generated in a loop.

At first I tried creating a custom configuration of $tags that the 
HtmlHelper would be using, but I quickly figured out that there was no 
+ specific configuration in the custom tag array.

On Tuesday, June 18, 2013 5:37:14 PM UTC+8, LDSign wrote:
>
> Hi
>
> Have a look at the form helper options (
> http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html).
>
> Using "format", "after","before" and "between" even complex wrapping is 
> possible. Ive used this in combination of an extended FormHelper to make 
> the markup for bootstrap (including errors, tooltips a.s.o.), but staying 
> as close to the core as possible.
>
> Cheers!
>
> Frank
>
> Am Dienstag, 18. Juni 2013 06:25:33 UTC+2 schrieb OJ Tibi - @ojtibi:
>>
>> Good day, folks!
>>
>> I was wondering if there was any quick option of making label tags wrap 
>> the inputs they're associated with, instead of sitting beside the input 
>> itself (e.g., labels for radio buttons generated by FormHelper->input() or 
>> FormHelper->radio() don't actually wrap the radio buttons they're 
>> associated with).
>>
>> Reason I'm asking this is that certain front-end frameworks like ZURB 
>> Foundation require labels to wrap radio buttons for the Custom Form 
>> features to work.
>>
>> Cheers,
>> OJ
>>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Quick way to wrap input[type=radio] in label tags?

2013-06-18 Thread LDSign
Hi

Have a look at the form helper options (
http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html).

Using "format", "after","before" and "between" even complex wrapping is 
possible. Ive used this in combination of an extended FormHelper to make 
the markup for bootstrap (including errors, tooltips a.s.o.), but staying 
as close to the core as possible.

Cheers!

Frank

Am Dienstag, 18. Juni 2013 06:25:33 UTC+2 schrieb OJ Tibi - @ojtibi:
>
> Good day, folks!
>
> I was wondering if there was any quick option of making label tags wrap 
> the inputs they're associated with, instead of sitting beside the input 
> itself (e.g., labels for radio buttons generated by FormHelper->input() or 
> FormHelper->radio() don't actually wrap the radio buttons they're 
> associated with).
>
> Reason I'm asking this is that certain front-end frameworks like ZURB 
> Foundation require labels to wrap radio buttons for the Custom Form 
> features to work.
>
> Cheers,
> OJ
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Quick way to wrap input[type=radio] in label tags?

2013-06-18 Thread 清水紘己
I think very quick and dirty way is to override radio() method of
FormHelper.
http://book.cakephp.org/2.0/en/views/helpers.html#using-and-configuring-helpers
Follow above, create MyFormHelper(or your preferring name), override
radio() method, and do preg_replace() to the result of parent method.

Rewriting tags of HtmlHelper is perhaps consistent way, but could not be
suitable for this case as I can see.


2013/6/18 Simon Males 

> I don't believe there is, I did it the 'long' way.
>
>
>
> On Tue, Jun 18, 2013 at 12:25 PM, OJ Tibi - @ojtibi wrote:
>
>> Good day, folks!
>>
>> I was wondering if there was any quick option of making label tags wrap
>> the inputs they're associated with, instead of sitting beside the input
>> itself (e.g., labels for radio buttons generated by FormHelper->input() or
>> FormHelper->radio() don't actually wrap the radio buttons they're
>> associated with).
>>
>> Reason I'm asking this is that certain front-end frameworks like ZURB
>> Foundation require labels to wrap radio buttons for the Custom Form
>> features to work.
>>
>> Cheers,
>> OJ
>>
>> --
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to cake-php+unsubscr...@googlegroups.com.
>> To post to this group, send email to cake-php@googlegroups.com.
>> Visit this group at http://groups.google.com/group/cake-php.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>
>
> --
> Simon Males
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Quick way to wrap input[type=radio] in label tags?

2013-06-17 Thread Simon Males
I don't believe there is, I did it the 'long' way.



On Tue, Jun 18, 2013 at 12:25 PM, OJ Tibi - @ojtibi wrote:

> Good day, folks!
>
> I was wondering if there was any quick option of making label tags wrap
> the inputs they're associated with, instead of sitting beside the input
> itself (e.g., labels for radio buttons generated by FormHelper->input() or
> FormHelper->radio() don't actually wrap the radio buttons they're
> associated with).
>
> Reason I'm asking this is that certain front-end frameworks like ZURB
> Foundation require labels to wrap radio buttons for the Custom Form
> features to work.
>
> Cheers,
> OJ
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Simon Males

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.