Take the 2-minute tour ×

I'm sure there is a relatively simple answer. I am trying to use CakePHP 2.0 to bake an application from the command line, and i would like cake to create the basic AuthComponent methods for my user model. the database table for users is named users, which includes the two necessary fields for auth, username and password.

I've been able to include AuthComponent in my usersController from bake, but have been unsuccessful at getting it to generate basic usersController actions for auth, such as login() and logout().

How can I do this? generating this skeleton code will help save a lot of time.

Thanks in advance!!!!

share|improve this question
add comment

1 Answer

default bake templates are only for CRUD (create=add, read=index,view update=edit, delete=delete), not for the rest. but it is fairly simple to customize your templates according to your needs.

Although login/logout are one-time-needed methods and don't make any sense to be baked. Its easier and faster to just manually "make" them. For login use the add template as basis, logout doesnt need any view.

share|improve this answer
Awesome. Yeah, i was just hoping that if I included the Auth component from bake, cake would take a hint a plop all of the AuthComponent specific junk into my project. Thanks. –  Todd Mar 13 '13 at 22:15
Auth is easy. Watch this: youtube.com/watch?v=zvwQGZ1BxdM –  rrd Mar 14 '13 at 10:55
lol. it's cake php... everything's technically easy. thanks for the response, though. –  Todd Mar 15 '13 at 16:29
add comment

Your Answer


