Mintak bantuan ... buat login guna table selain daripada table users ???
8 replies [Last post]
Budak baru belajo buat cake php ...
User offline. Last seen 4 years 13 weeks ago. Offline
Joined: 08/16/2009
Points: 1

Salam otai2 cakephp semua ... nak mintak tolong ni .. camne nak buat login guna table selain dripada table users contohnya table staff_infos -> nokp(username),katalaluan(password) .. tolong lar saya budak baru belajo .. masih blur lg pasal cakephp ni.. pertolongan anda semua amatlah saya hargai

does not have a status.
User offline. Last seen 4 years 6 weeks ago. Offline
Joined: 07/20/2010
Points: 5

btol tu..
nk tau jugak psl nie..
yg power2 nie..
tlg!!!!!!!

I'm noob
hymns's picture
User offline. Last seen 2 years 29 weeks ago. Offline
Pro
Joined: 08/16/2009
Points: 975

sama je. tukar je la nama table & field Big smile

Sedang mencari pembangun PHP yang berpengalaman.
User offline. Last seen 1 year 45 weeks ago. Offline
Pro
Joined: 06/28/2010
Points: 123

Boleh. Tukarlah tetapan AuthComponent.

Andaikan sudah ada model Pengguna yang menggunakan jadual 'staff_infos'.

<?php
    $this
->Auth->userModel = 'Pengguna';
   
$this->Auth->fields = array('username' => 'nokp', 'password' => 'katalaluan');
?>

Kod ini sepatutnya dimasukkan ke dalam kaedah beforeFilter() dalam AppController supaya semua pengawal lain juga boleh mewarisi sifat ini.

Untuk keterangan lanjut, sila kaji laman berikut:
http://book.cakephp.org/view/248/AuthComponent-Variables

Budak baru belajo buat cake php ...
User offline. Last seen 4 years 13 weeks ago. Offline
Joined: 08/16/2009
Points: 1

Terima kasih ... Big smile

does not have a status.
User offline. Last seen 4 years 6 weeks ago. Offline
Joined: 07/20/2010
Points: 5

oo..
okey..
maceh!!! Big smile

Sedang mencari pembangun PHP yang berpengalaman.
User offline. Last seen 1 year 45 weeks ago. Offline
Pro
Joined: 06/28/2010
Points: 123

Sama-sama.

Kalau ada masa luang, boleh kunjungi ke ulir Projek Euler: Uji kehebatan pengaturcaraan anda!

Menimba ilmu dari yang berpengalaman.
User offline. Last seen 3 years 31 weeks ago. Offline
Joined: 08/16/2009
Points: 9

Sorry this comment cannot be deleted. Weird. why. php.net.my administrator help!

keje :)
zam3858's picture
User offline. Last seen 47 weeks 3 days ago. Offline
Moderator
Joined: 04/26/2003
Points: 382

simpan je la. buat point. bila dah cecah 10,000 boleh tukar ngan free basic php training. Laughing out loud