Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Cakephp Auth Component Tutorial Part 1

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
12,775
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Sep 28, 2010

This is a three part series in understanding the basics of using Cakephp's Auth component. You will need to watch all three videos as they build on to each other by adding more functionality to the application.

  • likes, 1 dislikes

Link to this comment:

Share to:

Uploader Comments (andrewperk)

  • 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 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

  • Actually, i don't want id field in my table as an primary key. Is there any way

    to fix my problem?

  • @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 I meant a save.

  • Hi Andrew!

    i have another problem.

    Warning (512): SQL Error: 1054: Unknown column 'Usergroup.id' in 'where clause' [CORE\cake\libs\model\datasour­ces\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 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.

see all

All Comments (27)

Sign In or Sign Up now to post a comment!
  • 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????

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more