About the Tutorial


RegistrationController.php



Download 1,5 Mb.
Pdf ko'rish
bet72/96
Sana29.01.2022
Hajmi1,5 Mb.
#416930
1   ...   68   69   70   71   72   73   74   75   ...   96
Bog'liq
Download CakePHP Tutorial (PDF Version)

RegistrationController.php
file at 
src/Controller/RegistrationController.php

Copy the following code in the controller file. 
src/Controller/RegistrationController.php 
namespace App\Controller; 
use App\Controller\AppController; 
class RegistrationsController extends AppController{ 
public function index(){ 
$country = array('India','United State of America','United 
Kingdom'); 
$this->set('country',$country); 
$gender = array('Male','Female'); 
$this->set('gender',$gender); 


?> 
Create a directory 
Registrations
at 
src/Template
and under that directory create a 
View
file called 
index.ctp
. Copy the following code in that file. 
src/Template/Registrations/index.ctp 
echo $this->Form->create("Registrations",array('url'=>'/register')); 
echo $this->Form->input('username'); 
echo $this->Form->input('password'); 
echo $this->Form->input('password'); 
echo 'Country'; 
echo $this->Form->select('country',$country); 
echo 'Gender'; 
echo $this->Form->radio('gender',$gender); 
echo 'Address'; 
echo $this->Form->textarea('address'); 
echo $this->Form->file('profilepic'); 
echo '
'.$this->Form->checkbox('terms').'Terms & 
Conditions
'; 
echo $this->Form->button('Submit'); 


CakePHP 
64 
echo $this->Form->end(); 
?> 
Execute 
the 
above 
example 
by 
visiting 
the 
following 
URL: 
http://localhost:85/CakePHP/register
Output 
Upon execution, you will receive the following output. 


CakePHP 
65 
Like many other frameworks, CakePHP also supports Internationalization. We need to 
follow these steps to go from single language to multiple language. 

Download 1,5 Mb.

Do'stlaringiz bilan baham:
1   ...   68   69   70   71   72   73   74   75   ...   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