Wednesday, December 1, 2010

Re: dynamically changing the type in form helper

Correction...I shouldn't need to change it to {$type} so I will leave
it as is. Please let me know how else I can get this corrected.

Thanks again. Erik

On Dec 1, 1:02 pm, mochaman <mochama...@gmail.com> wrote:
> Yes, that was my first thought as I read that when going through it
> which is why I didn't make the change at first.  However, after
> looking at the core code, it seemed like something was missing in my
> version (not sure why or how, but it was not there).  You are
> correct...that is what I put using the word 'text' instead of {$type}
> -- originally, there was no $input line for the case 'text'.  If I am
> not suppose to change it, then how should I go about getting it
> corrected?  At a minimum, I will change mine to use {$type} instead of
> the word 'text'.
>
> Thanks.  Erik
>
> On Dec 1, 3:54 am, John Andersen <j.andersen...@gmail.com> wrote:
>
>
>
>
>
>
>
> > You should not change anything in the CakePHP core files!
> > What you have added is already there!
>
> > [core code]
> > case 'text':
> > case 'password':
> > case 'file':
> >         $input = $this->{$type}($fieldName, $options);
> > break;
> > [/core code]
>
> > is the same as your change:
>
> > [your code]
> > case 'text':
> >         $input = $this->text($fieldName, $options);
> > break;
> > case 'password':
> > case 'file':
> >         $input = $this->{$type}($fieldName, $options);
> > break;
> > [/your code]
>
> > Is the above what you have done?
>
> > Enjoy,
> >    John
>
> > On 1 Dec., 09:55, mochaman <mochama...@gmail.com> wrote:> Thanks for the reply...I was able to resolve it.
>
> > > I am using cakephp 1.3.5.  Looks like form.php was missing some code
> > > since I resolved it by adding the case for 'text' of $input=$this-
>
> > > >text($fieldName,$options); break; to the form.php file.
>
> > > Thanks again.  Erik
>
> > [snip]

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: