teutates 0 Posted December 19, 2012 Report Share Posted December 19, 2012 Hello, i'm a beginner at yii and i was hoping you could help me. i couldnt find a simmilair post so i sorry if i double post. i used : http://www.larryullman.com/2010/01/07/custom-authentication-using-the-yii-framework/ but i have a strange error. when i press the login button on my app. i get this error. include(leraarCode.php): failed to open stream: No such file or directory The strange thing is. the model is leraar. but i want leraarCode as username i followed every step. But somehow $model is appointed leraarCode instead of leraar :S And i cant find how it happend :/ http://pastebin.com/22pxH1TU (login.php) http://pastebin.com/vqf3Sxvq (useridentity.php) http://pastebin.com/TeqbUtyQ (loginform.php) http://pastebin.com/aPiLVh1p (sql for the model) Thanks for your time in advance. Greetings, Teutates Quote Link to post Share on other sites
Antonio Conte 426 Posted December 19, 2012 Report Share Posted December 19, 2012 include(leraarCode.php): failed to open stream: No such file or directory This is the problem. PHP cannot find your file. In the feature, do a search on the error message as it will often explain what's wrong. (The message kinda does too) This is a standard coding mistake and not related to YII per se. Make sure the file name is spelled correctly and has correct case. Quote Link to post Share on other sites
teutates 0 Posted December 19, 2012 Author Report Share Posted December 19, 2012 This is the problem. PHP cannot find your file. In the feature, do a search on the error message as it will often explain what's wrong. (The message kinda does too) This is a standard coding mistake and not related to YII. Well the reall problem is why it is looking for it. the model is named leraar. but the field is named leraarCode. as i grasp it. somehow the $model turned into a fieldname :/ Quote Link to post Share on other sites
Antonio Conte 426 Posted December 19, 2012 Report Share Posted December 19, 2012 Ok. I can see a jumped to a conclusion too soon. Sorry about that. Regardless, the problem is that you are missing a learaar model. You call learaar::findByAttributes() in you UserIdentity class, but it does not exist. The guide does not teach you have to implement the model part. More info here: http://www.yiiframework.com/doc/guide/1.1/en/database.ar It should be pretty straight forward to implement. Quote Link to post Share on other sites
Ziggi 5 Posted December 19, 2012 Report Share Posted December 19, 2012 Ensure you script according Yii conventions. Check class file names are capitalized properly etc. Quote Link to post Share on other sites
teutates 0 Posted December 20, 2012 Author Report Share Posted December 20, 2012 Ok. I can see a jumped to a conclusion too soon. Sorry about that. Regardless, the problem is that you are missing a learaar model. You call learaar::findByAttributes() in you UserIdentity class, but it does not exist. The guide does not teach you have to implement the model part. More info here: http://www.yiiframew.../en/database.ar It should be pretty straight forward to implement. Well maybe i wasnt clear enough it can happen. So the problem would be that the application can't find the model ( it does excists i used gii to create it before i started following the tutorial ) thanks for you time so far Quote Link to post Share on other sites
Larry 428 Posted December 21, 2012 Report Share Posted December 21, 2012 How about you clarify where you get that error? As in, what is the complete error message? The model is leraar (which, by the way, really should be uppercase), and your UserIdentity class uses it. So the question is where is it trying to create an object of type leraarCode? Quote Link to post Share on other sites
Ziggi 5 Posted December 23, 2012 Report Share Posted December 23, 2012 I bet this is the uppercase issue :-) Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.