Cakephp Auth Component Tutorial Part 1

  Рет қаралды 32,121

andrewperk

andrewperk

Күн бұрын

Пікірлер: 20
@andrewperk
@andrewperk 13 жыл бұрын
@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.
@nigelmccourt
@nigelmccourt 14 жыл бұрын
Thanks Andrew, this is excellent.
@andrewperk
@andrewperk 13 жыл бұрын
@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
@andrewperk 13 жыл бұрын
@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
@andrewperk 13 жыл бұрын
@TubePoster1 This is just how Cakephp has things structured. The app_controller.php belongs in the app folder.
@sanjaychouhan4018
@sanjaychouhan4018 9 жыл бұрын
Thank You very Much Andrew its very usefull and helping me to learn alot
@andrewperk
@andrewperk 14 жыл бұрын
@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.
@andrewperk
@andrewperk 13 жыл бұрын
@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.
@irishbloke99
@irishbloke99 12 жыл бұрын
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.
@andrewperk
@andrewperk 13 жыл бұрын
@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.
@muruganvellaisamy7599
@muruganvellaisamy7599 10 жыл бұрын
VERY USEFUL TO ME THANK U
@andrewperk
@andrewperk 14 жыл бұрын
@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.
@andrewperk
@andrewperk 13 жыл бұрын
@andrewperk I meant a save.
@MartaJohnsson
@MartaJohnsson 13 жыл бұрын
It should be I LOVE IT btn :-) Great job!
@khatritariq
@khatritariq 14 жыл бұрын
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
@KrissanawatKaewsanmuang
@KrissanawatKaewsanmuang 13 жыл бұрын
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
@Cathythan
@Cathythan 13 жыл бұрын
Actually, i don't want id field in my table as an primary key. Is there any way to fix my problem?
@TubePoster1
@TubePoster1 14 жыл бұрын
Why is that the AppController is not in the controllers folder? Isn't it also site wide?
@Cathythan
@Cathythan 13 жыл бұрын
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
@Cathythan 13 жыл бұрын
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?
Cakephp Auth Component Tutorial Part 2
12:18
andrewperk
Рет қаралды 13 М.
Cakephp Auth Component Tutorial Part 3
14:31
andrewperk
Рет қаралды 13 М.
Players vs Pitch 🤯
00:26
LE FOOT EN VIDÉO
Рет қаралды 124 МЛН
The Singing Challenge #joker #Harriet Quinn
00:35
佐助与鸣人
Рет қаралды 34 МЛН
World’s strongest WOMAN vs regular GIRLS
00:56
A4
Рет қаралды 35 МЛН
Cakephp 2.0 Blog Tutorial Update
22:47
andrewperk
Рет қаралды 17 М.
Cakephp 2.0 Auth Component Tutorial
54:39
andrewperk
Рет қаралды 79 М.
Cakephp Blog Tutorial Part 1 - Installation
5:50
andrewperk
Рет қаралды 173 М.
Cakephp Blog Tutorial Part 2 - Naming Conventions
8:00
andrewperk
Рет қаралды 93 М.
Cakephp Blog Tutorial Part 8 - Validation
9:13
andrewperk
Рет қаралды 27 М.
Cakephp Blog Tutorial Part 6 - Editing Posts
9:41
andrewperk
Рет қаралды 30 М.
Ruby on Rails Tutorial Part 9 - Validation & Error Messages
7:14
Ruby on Rails Tutorial Part 6 - CRUD - Create - Save Method
10:49
Ruby on Rails Tutorial Part 8 - CRUD - Delete - Destroy Method
4:45
СКОЛЬКО СТОИТ КАЖДЫЙ КОМП APPLE? (Ч.1)
0:37
ТЕСЛЕР
Рет қаралды 122 М.