Re: change label/input generated code
Perhaps place the $form-input within as an argument for $form-label and have it not escape? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: change label/input generated code
Hey Marcelo, You could just do something simply like: labelMy label: ?php echo $form-input('MyModel.field', array ('label'= false)); ?/label Or even better: Make your own helper that extends the Cake FormHelper and has a method that does this. -Matt http://www.pseudocoder.com On Jan 25, 11:59 am, Marcelo Andrade mfandr...@gmail.com wrote: Hi all, What's the better way to make the output of this echo $form-input('MyModel.field', array('label'= 'My label:')); generate labels surrounding the input element like this labelMy label: input type=text id=MyModelField //label instead of label for= version. ??? Best regards. -- MARCELO DE F. ANDRADE (aka eleKtron) Belem, PA, Amazonia, Brazil Linux User #221105 [...@pará ~]# linkshttp://pa.slackwarebrasil.org/ For Libby's backstory be told on Losthttp://www.petitiononline.com/libby423/petition.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: change label/input generated code
Your first suggestion is what I went with when I wanted to do the same. I figure there's no great need to have Cake output a label. It's convenient but, to get the markup I wanted, it made more sense to go around it. As for extending the helper, I tried that, too, at the time. But I never could quite figure out how HtmlHelper was doing things. On Mon, Jan 26, 2009 at 10:00 AM, Matt Curry m...@mcurry.net wrote: Hey Marcelo, You could just do something simply like: labelMy label: ?php echo $form-input('MyModel.field', array ('label'= false)); ?/label Or even better: Make your own helper that extends the Cake FormHelper and has a method that does this. -Matt http://www.pseudocoder.com On Jan 25, 11:59 am, Marcelo Andrade mfandr...@gmail.com wrote: Hi all, What's the better way to make the output of this echo $form-input('MyModel.field', array('label'= 'My label:')); generate labels surrounding the input element like this labelMy label: input type=text id=MyModelField //label instead of label for= version. ??? Best regards. -- MARCELO DE F. ANDRADE (aka eleKtron) Belem, PA, Amazonia, Brazil Linux User #221105 [...@pará ~]# linkshttp://pa.slackwarebrasil.org/ For Libby's backstory be told on Losthttp://www.petitiononline.com/libby423/petition.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
change label/input generated code
Hi all, What's the better way to make the output of this echo $form-input('MyModel.field', array('label'= 'My label:')); generate labels surrounding the input element like this labelMy label: input type=text id=MyModelField //label instead of label for= version. ??? Best regards. -- MARCELO DE F. ANDRADE (aka eleKtron) Belem, PA, Amazonia, Brazil Linux User #221105 [...@pará ~]# links http://pa.slackwarebrasil.org/ For Libby's backstory be told on Lost http://www.petitiononline.com/libby423/petition.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: change label/input generated code
I do not believe that is possible unless you build the elements yourself without the helper. Is there a reason your wrapping it like that? I do believe that is incorrect syntax. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: change label/input generated code
That syntax is fine. The difference is that, in wrapping the input with the label, the label is implicit, and so the for attribute is unnecessary. When using the for= syntax, the label is explicit. Both are acceptable but some screen-readers don't handle the implicit syntax well. One reason for using the implicit syntax is for styling. In some situations, it may be easier to define CSS rules for a label which wraps the input. On Sun, Jan 25, 2009 at 4:40 PM, Miles J mileswjohn...@gmail.com wrote: I do not believe that is possible unless you build the elements yourself without the helper. Is there a reason your wrapping it like that? I do believe that is incorrect syntax. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: change label/input generated code
On Sun, Jan 25, 2009 at 8:21 PM, brian bally.z...@gmail.com wrote: One reason for using the implicit syntax is for styling. In some situations, it may be easier to define CSS rules for a label which wraps the input. That's my case. I've found this ticket, but is not exactly related. https://trac.cakephp.org/ticket/5303 Best regards. -- MARCELO DE F. ANDRADE (aka eleKtron) Belem, PA, Amazonia, Brazil Linux User #221105 [...@pará ~]# links http://pa.slackwarebrasil.org/ For Libby's backstory be told on Lost http://www.petitiononline.com/libby423/petition.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: change label/input generated code
Its called using a div or a span. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: change label/input generated code
Call it what you like, the syntax remains valid. On Sun, Jan 25, 2009 at 10:39 PM, Miles J mileswjohn...@gmail.com wrote: Its called using a div or a span. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: change label/input generated code
just out of curiosity... valid for which doctype? On Sun, Jan 25, 2009 at 11:31 PM, brian bally.z...@gmail.com wrote: Call it what you like, the syntax remains valid. On Sun, Jan 25, 2009 at 10:39 PM, Miles J mileswjohn...@gmail.com wrote: Its called using a div or a span. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: change label/input generated code
looks like all of the various HTML XHTML versions: http://www.w3.org/TR/WCAG20-TECHS/H44.html On Mon, Jan 26, 2009 at 12:16 AM, Brian Williams brianw1...@gmail.com wrote: just out of curiosity... valid for which doctype? On Sun, Jan 25, 2009 at 11:31 PM, brian bally.z...@gmail.com wrote: Call it what you like, the syntax remains valid. On Sun, Jan 25, 2009 at 10:39 PM, Miles J mileswjohn...@gmail.com wrote: Its called using a div or a span. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: change label/input generated code
Eh it may be valid, I just don't believe it should be used that way. That's what block elements like div are used for. You also have a lot more control over the styling when not wrapping it in the label. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: change label/input generated code
committees! I hate the float model, myself. Anyway, it'd be best if Cake's mark-up was as configurable as the specs allowed for. I'm not saying it isn't already. I'm probably missing something. And, if it isn't, I'm sure it's not trivial to make it so. I did once need (want) to change Cake's label+input er ... output and I never did figure it out. So, to get back to the OP's question (sorry for the hijack), does anyone know how to fiddle with the label+input thingy? On Mon, Jan 26, 2009 at 1:38 AM, Miles J mileswjohn...@gmail.com wrote: Eh it may be valid, I just don't believe it should be used that way. That's what block elements like div are used for. You also have a lot more control over the styling when not wrapping it in the label. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---