About the Tutorial



Download 1,5 Mb.
Pdf ko'rish
bet56/96
Sana29.01.2022
Hajmi1,5 Mb.
#416930
1   ...   52   53   54   55   56   57   58   59   ...   96
Bog'liq
Download CakePHP Tutorial (PDF Version)

View
file under 
Users
directory called 
delete.ctp

src/Template/Users/delete.ctp 
Create a directory 
Users
at 
src/Template
, ignore if already created, and under that 
directory create a 
View
file called 
index.ctp
. Copy the following code in that file. 
src/Template/Users/index.ctp 
Add User 
 
 
 
 
 
 
 
 
foreach ($results as $row): 


CakePHP 
46 
echo "
"; 
echo ""; 
echo ""; 
echo ""; 
echo ""; 
endforeach; 
?> 
IDUsernamePasswordEditDelete
".$row->id."".$row->username."".$row->password."Url->build(["controller" => "Users","action" 
=> "edit",$row->id])."'>Edit
Url->build(["controller" => "Users","action" 
=> "delete",$row->id])."'>Delete
 
Execute the above example by visiting the following URL and click on 
Delete link
to delete 
record. 
http://localhost:85/CakePHP/users
 
Output 
After visiting the above URL and clicking on the Delete link, you will receive the following 
output where you can delete record. 


CakePHP 
47 
Authentication 
Authentication is the process of identifying the correct user. CakePHP supports three types 
of authentication. 

FormAuthenticate
— It allows you to authenticate users based on form POST 
data. Usually this is a login form that users enter information into. This is default 
authentication method. 

BasicAuthenticate
— It allows you to authenticate users using Basic HTTP 
authentication. 

DigestAuthenticate
— It allows you to authenticate users using Digest HTTP 
authentication. 
Example for FormAuthentication 
Make changes in the config/routes.php file as shown in the following code. 
config/routes.php 
use Cake\Core\Plugin; 
use Cake\Routing\RouteBuilder; 
use Cake\Routing\Router; 
Router::defaultRouteClass('DashedRoute'); 
Router::scope('/', function (RouteBuilder $routes) { 
$routes->connect('/auth',['controller'=>'Authexs','action'=>'index']); 
$routes->connect('/login',['controller'=>'Authexs','action'=>'login']); 
$routes->connect('/logout',['controller'=>'Authexs','action'=>'logout']); 
$routes->fallbacks('DashedRoute'); 
}); 
Plugin::routes(); 
Change the code of AppController.php file as shown in the following program. 
18.
 
CakePHP — Services 


CakePHP 
48 

Download 1,5 Mb.

Do'stlaringiz bilan baham:
1   ...   52   53   54   55   56   57   58   59   ...   96




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish