@Cathythan Yes its because you have no id field. You can set a model's primary key using its member variable var $primaryKey = 'jobTitle'. But usually the primary key is an integer and autoincrements rather than varchar.
@nigelmccourt14 жыл бұрын
Thanks Andrew, this is excellent.
@andrewperk13 жыл бұрын
@Erkotak Hi, I didn't bake a new application, I only baked the models/views/controllers for the Auth tutorial. There's a variety ways to bake. You can use bake to create a new application. Or you can just download the framework and bake individual things like models/views/controllers. Thats why you see the app and cake folders. When you bake a new application it only gives you the contents inside the app folder. When you download the framework and just bake your m/v/c's you retain the app folder
@andrewperk13 жыл бұрын
@Cathythan Well cakes conventions require that you have some type of field in your table that is an int, primary key, autoincrementing field. The only exception really is in a hasAndBelongsToMany association. In a HABTM you don't need a primary key in the HABTM table. You could modify your table to just add an ID field as the primary key AI. I don't think there is any way around this as when cake does a find using last_insert_id or something. You'll save yourself a lot of headache just using Id.
@andrewperk13 жыл бұрын
@TubePoster1 This is just how Cakephp has things structured. The app_controller.php belongs in the app folder.
@sanjaychouhan40189 жыл бұрын
Thank You very Much Andrew its very usefull and helping me to learn alot
@andrewperk14 жыл бұрын
@khatritariq The AppController that we made in the app folder is your applications controller in which you can put code in that all your other controllers inherit from. The AppController itself inherits from the Controller class in the cakephp libraries. The AppController that we created in the app folder overrides the AppController thats inside of the cake/libs/controller folder.
@andrewperk13 жыл бұрын
@Cathythan Hi, it should work. Double check that your UsersController extends AppController. Double check that the AppController that you made extends Controller. You may also try putting parent::beforeFilter(); in your UsersController beforeFilter function to make sure it has all the functionality of the AppControllers beforeFilter. It sounds like you might just have something not named properly. You can also send me your AppControlelr and UsersController code and I'll look at it.
@irishbloke9912 жыл бұрын
followed all your videos on cakephp, fanastic videos very well explained i thought i was finished until i seen these 3 videos on the Authcomponent, Anyone know where you can get a copy of cakephp 1.3 cant find it on the official site only 2.0.
@andrewperk13 жыл бұрын
@taqman001 I'm not sure why that would be happening. Try setting the password field to null or a blank string in the controller. Maybe you have a saved password for localhost and this is displaying the saved password in your password field while developing.
@muruganvellaisamy759910 жыл бұрын
VERY USEFUL TO ME THANK U
@andrewperk14 жыл бұрын
@logart00 I did it this way so that people wouldn't feel that they needed to watch 14 other videos to get started with Auth. They can just bake a new application and get started right away.
@andrewperk13 жыл бұрын
@andrewperk I meant a save.
@MartaJohnsson13 жыл бұрын
It should be I LOVE IT btn :-) Great job!
@khatritariq14 жыл бұрын
I am confused about AppController , first in the blog tutorial you inherited post_controller with AppController present in the "cake" folder , and now you have created Appcontroller class yourself in "app" folder, so which "Appcontroller" will the post_controller be inherited, the one u created yourself or the one present in cake folder. ? Please answer
@KrissanawatKaewsanmuang13 жыл бұрын
hi adrew My starting point is to write the registration page itself. Next I went to the author sign with auth component. This is the problem. In the registration page. Password box. Whenever I press the button to submit. Whether in the field is populated or not. A password automatic appears. I recognize the problem because I am before I could use auth component not problem Thank for suggest beginner
@Cathythan13 жыл бұрын
Actually, i don't want id field in my table as an primary key. Is there any way to fix my problem?
@TubePoster114 жыл бұрын
Why is that the AppController is not in the controllers folder? Isn't it also site wide?
@Cathythan13 жыл бұрын
Hi Andrew! i have another problem. Warning (512): SQL Error: 1054: Unknown column 'Usergroup.id' in 'where clause' [CORE\cake\libs\model\datasources\dbo_source.php, line 684] The usergroups table has 2 fields: jobTitle & groupId. Both are VARCHAR type. jobTitle is primary key. no id field and no association to any other table. i baked this table, then, I can add new usergroups and can see the list. but, when i access view and edit, this error appeared. Is it because of without id field?
@Cathythan13 жыл бұрын
hi Andrew, i followed accroding your Cakephp Auth Component tutorial. But, the problem is ...AppController. I created AppController (/app/app_controller.php), then declare "var $components=array('Auth','Session'). But, that Auth component doesn't work at all. Also,i can't access functions that is written in AppController. That's why, i tried another way, I put "var $components=array('Auth','Session') and functions in the UsersController, it works. Please help me, what is wrong with this?