Re: Strange problem setting a variable
Excellent, I'll remember to do that On 23 December 2010 18:46, cricket wrote: > On Thu, Dec 23, 2010 at 7:51 AM, euromark > wrote: > > only in cake1.2 > > in cake1.3 this is fixed > > Yes, that was an unwelcome feature. In the meantime, for 1.2.x, you can do: > > $this->set(compact('category_label'), false); > > 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+unsubscr...@googlegroups.comFor > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > -- Kind Regards Stephen @ NinjaCoderMonkey www.ninjacodermonkey.co.uk 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Strange problem setting a variable
On Thu, Dec 23, 2010 at 7:51 AM, euromark wrote: > only in cake1.2 > in cake1.3 this is fixed Yes, that was an unwelcome feature. In the meantime, for 1.2.x, you can do: $this->set(compact('category_label'), false); 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Strange problem setting a variable
only in cake1.2 in cake1.3 this is fixed On 23 Dez., 12:56, Stephen wrote: > Fixed it > > I am getting the following error when I access this function from the view: > > > *Notice (8): Undefined variable: category_label > > [APP\views\orders\add_category.ctp, line 4] > > > *Does anybody have any idea why "$this->set(compact( ..." doesn't seem to > > be sending the variable to the view? > > It seems that when you use compact with a variable that contains an > underscore, the variable will become Inflected. > > "category_label" becomes $categoryLabel in the view. > > Doh. > > -- > Kind Regards > Stephen @ NinjaCoderMonkey > > www.ninjacodermonkey.co.uk 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Strange problem setting a variable
Fixed it I am getting the following error when I access this function from the view: > > *Notice (8): Undefined variable: category_label > [APP\views\orders\add_category.ctp, line 4] > > *Does anybody have any idea why "$this->set(compact( ..." doesn't seem to > be sending the variable to the view? > > It seems that when you use compact with a variable that contains an underscore, the variable will become Inflected. "category_label" becomes $categoryLabel in the view. Doh. -- Kind Regards Stephen @ NinjaCoderMonkey www.ninjacodermonkey.co.uk 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Strange problem setting a variable
Hi there I have the following controller action which is accessed via ajax (select box, observeField) http://pastie.org/1400270 And here are the custom model functions it accesses http://pastie.org/1400273 I am getting the following error when I access this function from the view: *Notice (8): Undefined variable: category_label [APP\views\orders\add_category.ctp, line 4] *Does anybody have any idea why "$this->set(compact( ..." doesn't seem to be sending the variable to the view? -- Kind Regards Stephen @ NinjaCoderMonkey www.ninjacodermonkey.co.uk 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en