As always, there a many ways.
What I usually do is use Firebug to peek at what Cake assigns as the
ID or, if I want more control, I assign the IDs myself. Sometimes the
quick answer is to forget about being 'generic' and actually hard code
the function, i.e. instead of writing
[pseudo]
foreach checkbox:
do something
endforeach
It can save development time to write:
[pseudo]
do something to xx
do something to yy
do something to zz
Or put them in an array:
[pseudo]
checks = array(xx,yy,zz)
foreach checks:
do something
endforeach
Sorry if I seem a little patronising, but I sometimes find myself
agonising for hours over the best way to write five lines of code when
I could have written the same function in two minutes with ten lines.
There has to be a justifiable balance between maintainability and
producibility.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---