Re: Site Development from Start to Finish
At the time of last testing it wasn't, now it IS User and I'm getting all kids of errors. Without a $uses var, I get "Error: Database table homepages for model Homepage was not found." which is to be expected since there is no related MODEL for the homepages controller. With an empty $uses ( var $uses = array(); ) I get: Notice (8): Undefined property: HomepagesController::$User [APP/controllers/ homepages_controller.php, line 7] With a full $uses ( var $uses = array('User'); ) it works fine, as I stated previously. So it is apparent to me that $uses is required first if there is no related MODEL, and second if you want to access an unrelated MODEL. On Nov 14, 11:17 pm, Amit Badkas wrote: > Hi, > > It seems that the controller is not Users controller but anything else. Am I > right? > > Amit Badkas > > PHP Applications for E-Biz:http://www.sanisoft.com 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: Site Development from Start to Finish
Hi, It seems that the controller is not Users controller but anything else. Am I right? Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Sat, Nov 13, 2010 at 12:54 AM, naidim wrote: > I don't understand. Without the var $uses = array('User', 'Drug', > etc.) line, calls to $this->User->find() give this error: Fatal error: > Call to undefined method stdClass::find() With the uses line, it works > fine. > > On Nov 12, 11:13 am, Shaz wrote: > > It's better practice to use model relationships rather than $uses. > > i.e. $this->User->Drug->find(); > > 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 > 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: Site Development from Start to Finish
I don't understand. Without the var $uses = array('User', 'Drug', etc.) line, calls to $this->User->find() give this error: Fatal error: Call to undefined method stdClass::find() With the uses line, it works fine. On Nov 12, 11:13 am, Shaz wrote: > It's better practice to use model relationships rather than $uses. > i.e. $this->User->Drug->find(); 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: Site Development from Start to Finish
It's better practice to use model relationships rather than $uses. i.e. $this->User->Drug->find(); On Nov 12, 4:30 pm, naidim wrote: > For the homepage controller, if User and Drug are not related but you > want to use those models, you have to include them both. Maybe I > should specify that, thanks. > > Not sure I understand the 1.3 point. 'add' was added because I noticed > scaffold methods are not allowed when you allow('*'); so you have to > allow it specifically. Is that what the "^^" does? > > I don't change my hash, but just mention the option is there because > others might want to. How important is it to not change it? > > I totally don't understand the last point, sorry. > > On Nov 10, 7:07 pm, euromark wrote: > > > a few things > > > var $uses = array('User', 'Drugs'); > > i guess the drugs are related to users? > > var $uses = array('User'); > > might be just enough then > > > you mix 1.3 helper syntax and old syntax > > > $this->Auth->allow('*', 'add'); > > probably was meant to be > > $this->Auth->allow('*'); ^^ > > > i would not change the security hash function (and not to md5 in > > particular) > > > "$this->Auth->loginRedirect" etc > > careful: the urls should contain admin=>false and plugin=>false to > > avoid problems if you are > > in those routes! > > > other than that a nice tutorial for beginners 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: Site Development from Start to Finish
For the homepage controller, if User and Drug are not related but you want to use those models, you have to include them both. Maybe I should specify that, thanks. Not sure I understand the 1.3 point. 'add' was added because I noticed scaffold methods are not allowed when you allow('*'); so you have to allow it specifically. Is that what the "^^" does? I don't change my hash, but just mention the option is there because others might want to. How important is it to not change it? I totally don't understand the last point, sorry. On Nov 10, 7:07 pm, euromark wrote: > a few things > > var $uses = array('User', 'Drugs'); > i guess the drugs are related to users? > var $uses = array('User'); > might be just enough then > > you mix 1.3 helper syntax and old syntax > > $this->Auth->allow('*', 'add'); > probably was meant to be > $this->Auth->allow('*'); ^^ > > i would not change the security hash function (and not to md5 in > particular) > > "$this->Auth->loginRedirect" etc > careful: the urls should contain admin=>false and plugin=>false to > avoid problems if you are > in those routes! > > other than that a nice tutorial for beginners 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: Site Development from Start to Finish
a few things var $uses = array('User', 'Drugs'); i guess the drugs are related to users? var $uses = array('User'); might be just enough then you mix 1.3 helper syntax and old syntax $this->Auth->allow('*', 'add'); probably was meant to be $this->Auth->allow('*'); ^^ i would not change the security hash function (and not to md5 in particular) "$this->Auth->loginRedirect" etc careful: the urls should contain admin=>false and plugin=>false to avoid problems if you are in those routes! other than that a nice tutorial for beginners On 11 Nov., 02:08, naidim wrote: > For anyone interested, I'm documenting my site development to both > keep track of what I'm doing as well as help others walk through the > steps from start to finish of site creation in CakePHP. > > I've only just begun and won't have too much time to work on it since > I work full time and go to school full time, but I will finish it > eventually. Any and all comments and constructive criticism are > welcome. > > http://drug-ed.blogspot.com/ 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