On Sat, Feb 19, 2011 at 10:37 AM, Thomas <[email protected]> wrote:
> I have never used cake before but found myself thrust into it because
> a project I have inherited was developed using it. I must say I find
> it very inflexible as opposed to good old fashioned coding.
Perhaps you have that perception because you don't understand it yet.
> I have a
> form where the developers used iterating keys in the form. What I want
> to do, and what I am accustomed to doing when the number of inputs is
> variable or unknown is something like this: <input type=text
> name=something[]/> where it just plugs my post into an array with the
> key undeclared. How do you guys bake (correct term?) into your
> projects? This is what I have now:
> echo $form->checkbox('OnsiteTrainingClass.select_class'.
> $i,array('id'=>'select'.$i,'label'=>'','value'=>
> $value['OnsiteTrainingClass']['id']));
>
> If I take the $i out of this it hoses everything up.
Saying that it "hoses everything up" isn't very helpful towards
sorting out your problem. Meet us *al least* half-way. Some context
would be nice. Are you trying to move this code outside of the loop?
Why do you want to get rid of $i? What does the submitted data array
look like? And how do you want it to look? Is there a specific problem
you're trying to fix or is this just something you'd like to change
because it doesn't look like the code you're used to? Surely, you're
not so inflexible? ;-)
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php