Cakephp Auth Component Tutorial Part 1
Uploader Comments (andrewperk)
All Comments (27)
-
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.
-
It should be I LOVE IT btn :-) Great job!
-
means through following steps u made your application ?
1. u have copy pasted the downloaded framework inside 'cakeauth' folder.
2. Then u had create 'cakeauth' database with 2 tables i.e. 'posts' and 'users'.
3. Then u had probably make database.php from database.php.default and update the value of $default array. (also changes 2 values in core.php file)
4. Then through cmd prompt you changed directory to yr 'cakeauth' folder' .
5. And finally u had just bake M-V-C for both tables
right????
Hi Andrew
I am learning form your tutorial, I had also watched your cake php blog tutorial and learned how to create any application through cake bake (tut_blog2).....by the reference of that video I have created cakeauth application but in your video how could cakeauth folder contains 'app' folder as in starting of Cakephp Auth Component Tutorial Part 1 you mentioned that you had created this through cakebake application so how app folder could show inside yr cakebake folder..
Erkotak 8 months ago
@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
andrewperk 8 months ago
Actually, i don't want id field in my table as an primary key. Is there any way
to fix my problem?
Cathythan 9 months ago
@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.
andrewperk 9 months ago
@andrewperk I meant a save.
andrewperk 9 months ago
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?
Cathythan 9 months ago
@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.
andrewperk 9 months ago