0

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

RavatSinh Sisodiya
  • 1,596
  • 1
  • 20
  • 42
Todd
  • 5,314
  • 3
  • 28
  • 45

1 Answers1

2

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.

mark
  • 21,691
  • 3
  • 49
  • 71
  • 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
  • lol. it's cake php... everything's technically easy. thanks for the response, though. – Todd Mar 15 '13 at 16:29