ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
C¨¢ch t?o m?t module ??n gi?n tr¨ºn phpfox
? b¨¤i vi?t n¨¤y, t?i s? tr¨¬nh b¨¤y m?t c¨¢ch chi ti?t c¨¢c b??c x?y d?ng m?t module ??n gi?n tr¨ºn c?ng c?
phpfox. Ch¨²ng ta s? ti?p c?n b?ng c¨¢ch th?c hi?n m?t v¨ª d? c? th?, c¨¢c b?n c¨® th? ¨¢p d?ng nh?ng chi ti?t
trong v¨ª d? n¨¤y ?? ¨¢p d?ng cho nh?ng project c?a c¨¢c b?n.
?? b¨¤i: Vi?t m?t module tr¨ºn phpfox t?o m?t user v¨¤ insert th?ng tin user ?¨® v¨¤o c? s? d? li?u, ??ng th?i
hi?n th? th?ng tin user v?a t?o tr¨ºn m?t menu ? AdminCP.

C¨¢ch th?c hi?n:
Phi¨ºn b?n s? d?ng: phpfox 3.5.1
B?n c¨® th? download phpfox t?i ??y.
H??ng d?n c¨¤i ??t phpfox b?n c¨® th? tham kh?o ? ??y.

Create a new product
??u ti¨ºn b?n s? t?o m?t product m?i (n?i ch?a module c?a b?n). Tuy nhi¨ºn, ??y ch? l¨¤ b??c t¨´y ch?n v¨¬
b?n c¨® th? ??t module c?a m¨¬nh v¨¤o m?t product b?t k¨¬ c¨® s?n tr¨ºn phpfox. M?c d¨´ v?y, vi?c s? d?ng m?t
product ri¨ºng c?a b?n th?n s? gi¨²p b?n c¨® th? t¨´y bi?n d? d¨¤ng nh?ng ch?c n?ng trong n¨®. C¨¢c b??c ??
t?o m?t product m?i nh? sau:
??ng nh?p v?i t¨¤i kho?n AdminCP v¨¤ truy nh?p ???ng d?n sau:
Extensions >> Product >> Create New Product
?i?n ??y ?? c¨¢c th?ng tin v¨¤o form v¨¤ click n¨²t submit:

D??i ??y t?i s? gi?i th¨ªch chi ti?t th?ng tin c?a t?ng tr??ng:
?
?
?
?
?
?
?

Product ID: gi¨¢ tr? ID duy nh?t c?a product. N¨® c¨® th? l¨¤ k¨ª t? s?, ch? c¨¢i v¨¤ d?u g?ch d??i (_), v¨¤
lu?n ? d?ng ch? c¨¢i th??ng. ? ??y t?i s? ch?n l¨¤ create_user.
Title: ti¨ºu ?? c?a product, th? m¨¤ s? hi?n th? trong danh s¨¢ch c¨¢c product. ? ??y t?i s? ch?n l¨¤
Create new user.
Description: m? t? ng?n v? product. ? ??y t?i s? ch?n l¨¤ Create a new user manually.
Version: phi¨ºn b?n hi?n t?i c?a product. Do t?i m?i t?o product n¨¤y n¨ºn t?i s? ch?n l¨¤ 1.0.
Product URL: URL c?a website c?a b?n, ? ??y t?i s? d?ng localhost n¨ºn s? ?i?n l¨¤: localhost.
Version Check URL: URL ?? phpfox ki?m tra phi¨ºn b?n release c?a product. ? ??y t?i ?i?n l¨¤
localhost/version.php.
Active: thi?t l?p tr?ng th¨¢i c?a product l¨¤ active ho?c inactive. Ch?n Yes.

Create new module in AdminCP
??ng nh?p v¨¤o AdminCP v¨¤ v¨¤o theo ???ng d?n:
Extension >> Module >> Create New Module
Ti?p theo ch¨²ng ta s? ?i?n ??y ?? v¨¤o form d??i ??y v¨¤ click n¨²t submit:

Chi ti?t th?ng tin c?a t?ng tr??ng:
?
?
?
?

Product: t¨ºn c?a product ch?a module c?a b?n. ? ??y t?i s? chon l¨¤ Create new user.
Module ID: id c?a module. ? ??y t?i ch?n l¨¤ createuser.
Add to Menu: ch?n Yes ?? module c?a b?n xu?t hi?n trong Module menu.
Sub Menu: Khi b?n ch?n Yes ? ph?n Add to Menu, b?n s? b?t bu?c ph?i ?i?n th?ng tin ? m?c Sub
Menu n¨¤y. ? ??y ch¨²ng ta s? ??nh ngh?a t¨ºn c?a c¨¢c sub menu v¨¤ URL t??ng ?ng. T?i s? t?o 2 sub
menu: Show info ?? hi?n th? th?ng tin ng??i d¨´ng, v?i link createuser ???c hi?u l¨¤ ???ng d?n
http://localhost/phpFox-3.5.1/upload/index.php?do=/admincp/createuser/; Add new t?o form
?? ?i?n th?ng tin ng??i d¨´ng v¨¤ insert th?ng tin ?¨® v¨¤o c? s? d? li?u, v?i link createuser.add ??i
?

di?n
cho
???ng
d?n
http://localhost/phpFox3.5.1/upload/index.php?do=/admincp/createuser/add/.
Info: M? t? ng?n v? module. ? ??y t?i ch?n l¨¤ Admin can create a new user manually!.

Build file structure
D?n ??n folder /module/ tr¨ºn server c?a b?n n?i ch?a file c¨¤i ??t c?a phpfox. T?o m?t folder m?i v?i t¨ºn
c?a module m¨¤ b?n v?a t?o, c?a t?i l¨¤ createuser. B¨ºn trong folder m?i b?n s? t?o theo c?u tr¨²c sau:
/include/
/include/component/
/include/component/ajax/
/include/component/block/
/include/component/controller/
/include/component/controller/admincp
/include/plugin/
/include/service/
/static/
/static/css/default/default/
/static/image/
/static/jscript/
/template/
/template/default/
/template/default/block/
/template/default/controller/
/template/default/controller/admincp
Ch¨² ? r?ng ??y l¨¤ c?u tr¨²c file d?ng ??y ?? c?a m?t module, v¨¬ v?y t¨´y v¨¤o m?c ?¨ªch c?a b?n m¨¤ b?n c¨®
th? ch? c?n t?o m?t s? th? m?c c?n thi?t.

Create a controller
Controller l¨¤ nh?ng file php ?i?u khi?n t?t c? c¨¢c page c?a phpfox. ??u ti¨ºn h?y t?o m?t php class file cho
controller c?a ch¨²ng ta:
/module/createuser/include/component/controller/admincp/index.class.ph
p
N?i dung c?a file index.class.php nh? sau:
index.class.php
<?php
class Createuser_Component_Controller_Admincp_Index extends Phpfox_Component
{
public function process() {
}
}
?>

Ti?p theo ch¨²ng ta s? t?o m?t file HTML cho controller v?a t?o c?a ch¨²ng ta:
modulecreateusertemplatedefaultcontrolleradmincpindex.html.php
Trong file index.html.php, b?n c¨® th? th¨ºm d¨°ng sau ?? ki?m tra t¨ªnh k?t n?i gi?a file controller v¨¤ html
m¨¤ b?n v?a t?o.
index.html.php
Helloworld!
Truy nh?p v¨¤o ???ng d?n sau:
http://localhost/phpFox-3.5.1/upload/index.php?do=/admincp/createuser/
Ho?c truy nh?p v¨¤o AdminCP v¨¤ ?i theo ???ng d?n:
Module >> Createuser >> Show info
??y l¨¤ k?t qu? thu ???c:

Gi?i th¨ªch chi ti?t:
T¨ºn l?p trong file index.class.php l¨¤:
Createuser_Component_Controller_Admincp_Index
N?u thay d?u g?ch d??i (_) b?ng d?u g?ch tr¨¢i (/) th¨¬ n¨® s? nh?c b?n t?i ???ng d?n ??n file index.class.php
c?a ch¨²ng ta:
/module/createuser/include/component/controller/admincp/index.class.ph
p
L?p n¨¤y s? k? th?a t? l?p Phpfox_Component, l? do l¨¤ n¨® n?m trong th? m?c Component.
?? th?c thi ???c controller n¨¤y, ta c?n cung c?p ph??ng th?c public process().
C¨¢i t¨ºn index ? ??y l¨¤ b?t bu?c khi b?n mu?n d?n ??n module g?c ? ???ng link:
http://localhost/phpFox-3.5.1/upload/index.php?do=/admincp/createuser/
Ti?p theo ch¨²ng ta s? t?o file add.class.php, ??y s? l¨¤ controller c?a ???ng d?n:
http://localhost/phpFox-3.5.1/upload/index.php?do=/admincp/createuser/add/
V¨¤ t?t nhi¨ºn b?n v?n s? ph?i t?o m?t file html t??ng ?ng (add.html.php) ? th? m?c
modulecreateusertemplatedefaultcontrolleradmincp ?? hi?n th? th?ng tin c?n thi?t.
Ta s? x?y d?ng form trong add.html.php ?? nh?p th?ng tin user c?n t?o. ??y l¨¤ d?ng form m¨¤ t?i ?? t?o.

V¨¤ d??i ??y l¨¤ ?o?n code t??ng ?ng:
add.html.php
<html>
<body>
<form action="{url link='admincp.createuser.index'}"
method="post" id="add_new_user">
<div class="user_create">
<div class="table_header">
User Infomation
</div>
<div class="table">
<div class="table_left">
{required}Full name:
</div>
<div class="table_right">
<input type="text" name="full_name"
size="40" value="yourname" />
</div>
</div>
<div class="table">
<div class="table_left">
{required}Email:
</div>
<div class="table_right">
<input type="text" name="email"
size="40" value="someone@example.com" required />
</div>
</div>
<div class="table">
<div class="table_left">
{required}Password:
</div>
<div class="table_right">
<input type="password" name="password"
size="40" value="" required/>
</div>
</div>
<div class="table">
<div class="table_left">
{required}Birthday:
</div>
<div class="table_right">
<select name="month">
<option value="">Month: </option>
{foreach from=$months item=month}
<option
value={$i++}>{$month}</option>
{/foreach}
</select>
/
<select name="day">
<option value="">Day: </option>
{foreach from=$days item=day}
<option
value={$day}>{$day}</option>
{/foreach}
</select>
/
<select name="year">
<option value="">Year: </option>
{foreach from=$years item=year}
<option
value={$year}>{$year}</option>
{/foreach}
</select>
</div>
</div>
<div class="table">
<div class="table_left">
{required}I am:
</div>
<div class="table_right">
<select name="gender">
<option value="">Select: </option>
<option value="1">Male</option>
<option value="2">Female</option>
</select>
</div>
</div>
<div class="table_clear">
<input type="submit" value="{phrase
var='core.submit'}" class="button" name="submit" />
</div>
</div>
</form>
</body>
</html>

Gi?i th¨ªch code:
Action ? form l¨¤:
action="{url link='admincp.createuser.index'}"
Link 'admincp.createuser.index¡¯ c¨® d?ng ¡®[admincp.]module_name.file_name_prefix¡¯, ph?n admincp. c¨®
th? c¨® ho?c kh?ng t¨´y thu?c v¨¤o vi?c module th?c hi?n tr¨ºn admincp hay tr¨ºn site th?ng th??ng. ? ngh?a
l¨¤ form n¨¤y sau khi click submit s? th?c hi?n ?o?n code trong file index.class.php v¨¤ index.html.php.
C¨¢c th? div ? ??y t?i c¨® s? d?ng c¨¢c class ???c ??nh ngh?a s?n trong phpfox ?? ??ng nh?t v?i nh?ng form
c?a c¨¢c module kh¨¢c. Th?ng tin v? c¨¢c class n¨¤y b?n c¨® th? xem trong c¨¢c file html n?m trong c¨¢c module
c¨® s?n c?a phpfox.
T? {required} thay th? cho d?u * m¨¤u ??.
Ti?p theo l¨¤ m?t v¨°ng l?p kh¨¢ ??c bi?t:
{foreach from=$months item=month}...{/foreach}
V¨°ng l?p n¨¤y c¨® ngh?a l¨¤ duy?t t?t c? c¨¢c ph?n t? trong m?ng $months, m?i ph?n t? s? ???c ??i di?n b?i
bi?n $month. Trong PHP, v¨°ng l?p n¨¤y s? ???c vi?t l?i nh? sau:
foreach($months as $month){}
C?u h?i l¨¤ m?ng $months n¨¤y ???c l?y t? ??u ra? Th?c ra m?ng $month ???c g¨¢n trong file
add.class.php. N?i dung file add.class.php nh? sau:
add.class.php
<?php
class Createuser_Component_Controller_Admincp_Add extends Phpfox_Component{
public function process() {
$month = array('January', 'February', 'March', 'April', 'May',
'June', 'July', 'August', 'September', 'October', 'November', 'December');
$day = array();
$year = array();
for ($i = 1; $i < 32; $i++) {
$day[] = $i;
}
for ($j = 1900; $j < 2015; $j++) {
$year[] = $j;
}
$this->template()->assign(array(
'months' => $month,
'days' => $day,
'years' => $year
));
}
}
?>

B?i v¨¬ ?o?n m? c?a ch¨²ng ta s? d?ng m? h¨¬nh MVC, t?c l¨¤ logic PHP trong file class t¨¢ch bi?t v?i logic thi?t
k? trong file html, v¨¬ v?y c¨¢c th?ng tin trong file class s? ???c g¨¢n v¨¤o c¨¢c bi?n ?? s? d?ng trong file html.
Phpfox cung c?p ph??ng th?c assign() c¨® trong l?p Phpfox_Template ?? th?c hi?n ph¨¦p g¨¢n n¨¤y.

Hi?n th? th?ng tin ng??i d¨´ng tr¨ºn menu Show info
Menu
Show
info
c¨®
url
d?n
??n
module
g?c
http://localhost/phpFox3.5.1/upload/index.php?do=/admincp/createuser/. Do ?¨® ta s? x?y d?ng giao di?n cho menu n¨¤y qua file
index.html.php v¨¤ ?i?u khi?n b?ng controller index.class.php.
N?i dung file index.html.php:
index.html.php
<html>
<div class="table_header">
Show user info
</div>
<div class="table">
<div class="table_left">
Name:
</div>
<div class="table_right">
{$fulname}
</div>
</div>
<div class="table">
<div class="table_left">
Email:
</div>
<div class="table_right">
{$email}
</div>
</div>
<div class="table">
<div class="table_left">
Birthday:
</div>
<div class="table_right">
{$birthday}
</div>
</div>
<div class="table">
<div class="table_left">
Gender:
</div>
<div class="table_right">
{$gender}
</div>
</div>
</html>

C¨¢c bi?n c?n l?y ? ??y l¨¤ $fulname, $email, $birthday, $gender. Nh?ng bi?n n¨¤y s? ???c l?y b?ng m?ng
$_POST th?ng qua form ???c x?y d?ng ? file add.html.php.
N?i dung c?a file index.class.php:
index.class.php
<?php
class Createuser_Component_Controller_Admincp_Index extends Phpfox_Component
{
public function process() {
$this->template()->assign(array(
'fulname' => $_POST['full_name'],
'email' => $_POST['email'],
'password' => md5($_POST['password']),
'birthday' => $month . $_POST['day'] .
$_POST['year'],
'gender' => $_POST['gender']
));
}
}
?>

??n ??y ta s? test th? vi?c hi?n th? th?ng tin ng??i d¨´ng. Truy nh?p theo ???ng d?n
http://localhost/phpFox-3.5.1/upload/index.php?do=/admincp/createuser/add/ ho?c ??ng nh?p v¨¤o
AdminCP, truy nh?p v¨¤o ???ng d?n Module ? Createuser ? Add new, nh?p ??y ?? th?ng tin v¨¤o form
sau:

Click Submit v¨¤ h? th?ng s? t? ??ng ?i?u h??ng ??n link http://localhost/phpFox3.5.1/upload/index.php?do=/admincp/createuser/index/:
Insert th?ng tin ng??i d¨´ng v¨¤o c? s? d? li?u
?? truy nh?p v¨¤ th?c hi?n c¨¢c ph??ng th?c l¨ºn c? s? d? li?u, t?i s? t?o m?t service extends t?
Phpfox_Service. File service n¨¤y n?m tr¨ºn ???ng d?n:
modulecreateuserincludeservicecreateuser.class.php
Phpfox quy ??nh m?i module ch? c¨® m?t service duy nh?t ?? thao t¨¢c v?i c? s? d? li?u v¨¤ ch? c¨® t¨ºn d?ng
module_name.class.php. N?i dung c?a file createuser.class.php:
createuser.class.php
<?php
class Createuser_Service_Createuser extends Phpfox_Service {
public function insert_user() {
$month = $_POST['month'];
switch ($month) {
case 'January': $month = '01';
break;
case 'February': $month = '02';
break;
case 'March': $month = '03';
break;
case 'April': $month = '04';
break;
case 'May': $month = '05';
break;
case 'June': $month = '06';
break;
case 'July': $month = '07';
break;
case 'August': $month = '08';
break;
case 'September': $month = '09';
break;
case 'October': $month = 10;
break;
case 'November': $month = 11;
break;
case 'December': $month = 12;
break;
}
$insert = Phpfox::getLib('database')->insert('phpfox_user',
array(
'user_group_id' => '2',
'full_name' => $_POST['full_name'],
'email' => $_POST['email'],
'password' => md5($_POST['password']),
'birthday' => $month . $_POST['day'] .
$_POST['year'],
'gender' => $_POST['gender']
));
return $insert;
}
}
?>

T¨ºn l?p v?n tu?n th? theo ??nh d?ng ???c ??nh ngh?a ? tr¨ºn.
Do gi¨¢ tr? $month ban ??u ? d?ng ch? m¨¤ kh?ng ph?i d?ng s?, trong khi d?ng hi?n th? birthday trong c?
s? d? li?u l¨¤ mmddyyyy, n¨ºn ta s? chuy?n gi¨¢ tr? $month t? d?ng ch? sang d?ng s? cho ph¨´ h?p.
C¨® 2 c¨¢ch ?? th?c hi?n insert v¨¤o c? s? d? li?u:
$this¡údatabase()¡úinsert(¡®table_name¡¯, array(¡®collumn_name_1¡¯ =>¡®value_1¡¯,
¡®collumn_name_2¡¯ => ¡®value_2¡¯, ¡­));
Phpfox::getLib('database')->insert(¡®table_name¡¯, array(¡®collumn_name_1¡¯ =>¡®value_1¡¯,

¡®collumn_name_2¡¯ => ¡®value_2¡¯, ¡­));
? ?¨® column_name_i l¨¤ t¨ºn c?t th? i, c¨°n value_i l¨¤ gi¨¢ tr? c?a c?t t??ng ?ng.
Ti?p theo ch¨²ng ta s? th?c thi service n¨¤y. Y¨ºu c?u l¨¤ click n¨²t Submit th¨¬ service n¨¤y c?ng ???c th?c thi,
n¨ºn ta s? th?c hi?n vi?c th?c thi n¨¤y trong ph??ng th?c process c?a file index.class.php. Ch¨²ng ta s? th¨ºm
?o?n code sau trong file index.class.php.
Phpfox::getService('createuser')->insert_user();
Ph??ng th?c getService nh?n tham s? l¨¤ t¨ºn module v¨¤ g?i ??n ph??ng th?c insert_user() ?? th?c hi?n
vi?c insert th?ng tin ng??i d¨´ng v¨¤o c? s? d? li?u.

Test
Ch¨²ng ta s? th?c hi?n test v?i ng??i d¨´ng John Adam ? tr¨ºn. ??y l¨¤ ?nh c? s? d? li?u tr??c khi click n¨²t
Submit.
Sau khi click n¨²t Submit.

Ch¨² ?: Do ? ??y t?i th?c hi?n tr¨ºn localhost n¨ºn c¨¢c ???ng d?n ??u b?t ??u b?ng localhost, n?u b?n t?o
module tr¨ºn server c?a b?n, h?y thay localhost b?ng t¨ºn site c?a b?n trong c¨¢c ???ng d?n m¨¤ t?i ??a ra.

More Related Content

What's hot (20)

B¨¤i 7 X?y d?ng website s? d?ng PHP v¨¤ MySQL - Gi¨¢o tr¨¬nh FPT
B¨¤i 7 X?y d?ng website s? d?ng PHP v¨¤ MySQL - Gi¨¢o tr¨¬nh FPTB¨¤i 7 X?y d?ng website s? d?ng PHP v¨¤ MySQL - Gi¨¢o tr¨¬nh FPT
B¨¤i 7 X?y d?ng website s? d?ng PHP v¨¤ MySQL - Gi¨¢o tr¨¬nh FPT
MasterCode.vn
?
B¨¤i 4 B?o m?t cho website - X?y d?ng ?ng d?ng web
B¨¤i 4 B?o m?t cho website - X?y d?ng ?ng d?ng webB¨¤i 4 B?o m?t cho website - X?y d?ng ?ng d?ng web
B¨¤i 4 B?o m?t cho website - X?y d?ng ?ng d?ng web
MasterCode.vn
?
B¨¤i 2 C¨¢c k? thu?t l?p tr¨¬nh MySQL v?i PHP n?ng cao - X?y d?ng ?ng d?ng web
B¨¤i 2 C¨¢c k? thu?t l?p tr¨¬nh MySQL v?i PHP n?ng cao - X?y d?ng ?ng d?ng webB¨¤i 2 C¨¢c k? thu?t l?p tr¨¬nh MySQL v?i PHP n?ng cao - X?y d?ng ?ng d?ng web
B¨¤i 2 C¨¢c k? thu?t l?p tr¨¬nh MySQL v?i PHP n?ng cao - X?y d?ng ?ng d?ng web
MasterCode.vn
?
Web301 slide 4
Web301   slide 4Web301   slide 4
Web301 slide 4
tuanduongcntt
?
B¨¤i 2 L¨¤m quen v?i m?i tr??ng PHP v¨¤ MySQL (ph?n 2) - Gi¨¢o tr¨¬nh FPT
B¨¤i 2 L¨¤m quen v?i m?i tr??ng PHP v¨¤ MySQL (ph?n 2) - Gi¨¢o tr¨¬nh FPTB¨¤i 2 L¨¤m quen v?i m?i tr??ng PHP v¨¤ MySQL (ph?n 2) - Gi¨¢o tr¨¬nh FPT
B¨¤i 2 L¨¤m quen v?i m?i tr??ng PHP v¨¤ MySQL (ph?n 2) - Gi¨¢o tr¨¬nh FPT
MasterCode.vn
?
Web201 slide 2
Web201   slide 2Web201   slide 2
Web201 slide 2
tuanduongcntt
?
Web3012 assignment
Web3012   assignmentWeb3012   assignment
Web3012 assignment
tuanduongcntt
?
Gioi thieu joomla
Gioi thieu joomlaGioi thieu joomla
Gioi thieu joomla
Hoang Huy Phuong
?
Web203 slide 5
Web203   slide 5Web203   slide 5
Web203 slide 5
tuanduongcntt
?
Web301 slide 7
Web301   slide 7Web301   slide 7
Web301 slide 7
tuanduongcntt
?
T¨¤i li?u Zend Framework 2 - C¨¤i ??t v¨¤ c?u h¨¬nh Zend Framework 2 - B¨¤i 2
T¨¤i li?u Zend Framework 2 - C¨¤i ??t v¨¤ c?u h¨¬nh Zend Framework 2 - B¨¤i 2T¨¤i li?u Zend Framework 2 - C¨¤i ??t v¨¤ c?u h¨¬nh Zend Framework 2 - B¨¤i 2
T¨¤i li?u Zend Framework 2 - C¨¤i ??t v¨¤ c?u h¨¬nh Zend Framework 2 - B¨¤i 2
KhanhPham
?
T¨¬m hi?u v? Joomla
T¨¬m hi?u v? Joomla T¨¬m hi?u v? Joomla
T¨¬m hi?u v? Joomla
L??ng B¨¢ H?p
?
Web301 slide 1
Web301   slide 1Web301   slide 1
Web301 slide 1
tuanduongcntt
?
H??ng d?n c?p nh?t b¨¤i vi?t tr¨ºn Joomla
H??ng d?n c?p nh?t b¨¤i vi?t tr¨ºn JoomlaH??ng d?n c?p nh?t b¨¤i vi?t tr¨ºn Joomla
H??ng d?n c?p nh?t b¨¤i vi?t tr¨ºn Joomla
Minhtuan Chau
?
B¨¤i 1 L?p tr¨¬nh website theo m? h¨¬nh MVC - X?y d?ng ?ng d?ng web
B¨¤i 1 L?p tr¨¬nh website theo m? h¨¬nh MVC - X?y d?ng ?ng d?ng webB¨¤i 1 L?p tr¨¬nh website theo m? h¨¬nh MVC - X?y d?ng ?ng d?ng web
B¨¤i 1 L?p tr¨¬nh website theo m? h¨¬nh MVC - X?y d?ng ?ng d?ng web
MasterCode.vn
?
Asp.net mvc 3 (c#) (9 tutorials) egroups vn
Asp.net mvc 3 (c#) (9 tutorials)   egroups vnAsp.net mvc 3 (c#) (9 tutorials)   egroups vn
Asp.net mvc 3 (c#) (9 tutorials) egroups vn
Nguyen Van Hung
?
Lap trinh-joomla-15-theo-mo-hinh-mvc
Lap trinh-joomla-15-theo-mo-hinh-mvcLap trinh-joomla-15-theo-mo-hinh-mvc
Lap trinh-joomla-15-theo-mo-hinh-mvc
Che Linh Nguyen
?
Qu?n tr? joomla to¨¤n t?p
Qu?n tr? joomla to¨¤n t?pQu?n tr? joomla to¨¤n t?p
Qu?n tr? joomla to¨¤n t?p
dvms
?
B¨¤i 7 X?y d?ng website s? d?ng PHP v¨¤ MySQL - Gi¨¢o tr¨¬nh FPT
B¨¤i 7 X?y d?ng website s? d?ng PHP v¨¤ MySQL - Gi¨¢o tr¨¬nh FPTB¨¤i 7 X?y d?ng website s? d?ng PHP v¨¤ MySQL - Gi¨¢o tr¨¬nh FPT
B¨¤i 7 X?y d?ng website s? d?ng PHP v¨¤ MySQL - Gi¨¢o tr¨¬nh FPT
MasterCode.vn
?
B¨¤i 4 B?o m?t cho website - X?y d?ng ?ng d?ng web
B¨¤i 4 B?o m?t cho website - X?y d?ng ?ng d?ng webB¨¤i 4 B?o m?t cho website - X?y d?ng ?ng d?ng web
B¨¤i 4 B?o m?t cho website - X?y d?ng ?ng d?ng web
MasterCode.vn
?
B¨¤i 2 C¨¢c k? thu?t l?p tr¨¬nh MySQL v?i PHP n?ng cao - X?y d?ng ?ng d?ng web
B¨¤i 2 C¨¢c k? thu?t l?p tr¨¬nh MySQL v?i PHP n?ng cao - X?y d?ng ?ng d?ng webB¨¤i 2 C¨¢c k? thu?t l?p tr¨¬nh MySQL v?i PHP n?ng cao - X?y d?ng ?ng d?ng web
B¨¤i 2 C¨¢c k? thu?t l?p tr¨¬nh MySQL v?i PHP n?ng cao - X?y d?ng ?ng d?ng web
MasterCode.vn
?
B¨¤i 2 L¨¤m quen v?i m?i tr??ng PHP v¨¤ MySQL (ph?n 2) - Gi¨¢o tr¨¬nh FPT
B¨¤i 2 L¨¤m quen v?i m?i tr??ng PHP v¨¤ MySQL (ph?n 2) - Gi¨¢o tr¨¬nh FPTB¨¤i 2 L¨¤m quen v?i m?i tr??ng PHP v¨¤ MySQL (ph?n 2) - Gi¨¢o tr¨¬nh FPT
B¨¤i 2 L¨¤m quen v?i m?i tr??ng PHP v¨¤ MySQL (ph?n 2) - Gi¨¢o tr¨¬nh FPT
MasterCode.vn
?
T¨¤i li?u Zend Framework 2 - C¨¤i ??t v¨¤ c?u h¨¬nh Zend Framework 2 - B¨¤i 2
T¨¤i li?u Zend Framework 2 - C¨¤i ??t v¨¤ c?u h¨¬nh Zend Framework 2 - B¨¤i 2T¨¤i li?u Zend Framework 2 - C¨¤i ??t v¨¤ c?u h¨¬nh Zend Framework 2 - B¨¤i 2
T¨¤i li?u Zend Framework 2 - C¨¤i ??t v¨¤ c?u h¨¬nh Zend Framework 2 - B¨¤i 2
KhanhPham
?
H??ng d?n c?p nh?t b¨¤i vi?t tr¨ºn Joomla
H??ng d?n c?p nh?t b¨¤i vi?t tr¨ºn JoomlaH??ng d?n c?p nh?t b¨¤i vi?t tr¨ºn Joomla
H??ng d?n c?p nh?t b¨¤i vi?t tr¨ºn Joomla
Minhtuan Chau
?
B¨¤i 1 L?p tr¨¬nh website theo m? h¨¬nh MVC - X?y d?ng ?ng d?ng web
B¨¤i 1 L?p tr¨¬nh website theo m? h¨¬nh MVC - X?y d?ng ?ng d?ng webB¨¤i 1 L?p tr¨¬nh website theo m? h¨¬nh MVC - X?y d?ng ?ng d?ng web
B¨¤i 1 L?p tr¨¬nh website theo m? h¨¬nh MVC - X?y d?ng ?ng d?ng web
MasterCode.vn
?
Asp.net mvc 3 (c#) (9 tutorials) egroups vn
Asp.net mvc 3 (c#) (9 tutorials)   egroups vnAsp.net mvc 3 (c#) (9 tutorials)   egroups vn
Asp.net mvc 3 (c#) (9 tutorials) egroups vn
Nguyen Van Hung
?
Lap trinh-joomla-15-theo-mo-hinh-mvc
Lap trinh-joomla-15-theo-mo-hinh-mvcLap trinh-joomla-15-theo-mo-hinh-mvc
Lap trinh-joomla-15-theo-mo-hinh-mvc
Che Linh Nguyen
?
Qu?n tr? joomla to¨¤n t?p
Qu?n tr? joomla to¨¤n t?pQu?n tr? joomla to¨¤n t?p
Qu?n tr? joomla to¨¤n t?p
dvms
?

Viewers also liked (9)

Taylor swift khen toc tien giong marilyn monroe
Taylor swift khen toc tien giong marilyn monroeTaylor swift khen toc tien giong marilyn monroe
Taylor swift khen toc tien giong marilyn monroe
Nguyen Tuan Anh
?
¹óµþ±õ´Á´©»ÑÑÔ¹ßÓþŴóÃØóÅ
¹óµþ±õ´Á´©»ÑÑÔ¹ßÓþŴóÃØóŹóµþ±õ´Á´©»ÑÑÔ¹ßÓþŴóÃØóÅ
¹óµþ±õ´Á´©»ÑÑÔ¹ßÓþŴóÃØóÅ
Flora Lan
?
»·±£Éè¼Æ Eco design
»·±£Éè¼Æ Eco design»·±£Éè¼Æ Eco design
»·±£Éè¼Æ Eco design
Flora Lan
?
Facebook §Ó §ã§Ú§ã§ä§Ö§Þ? §Ò?§Ò§Ý?§à§ä§Ö§é§ß§Ú§ç ?§ß§ä§Ö§â§ß§Ö§ä-§Ü§à§Þ§å§ß?§Ü§Ñ§è?§Û
Facebook §Ó §ã§Ú§ã§ä§Ö§Þ? §Ò?§Ò§Ý?§à§ä§Ö§é§ß§Ú§ç ?§ß§ä§Ö§â§ß§Ö§ä-§Ü§à§Þ§å§ß?§Ü§Ñ§è?§ÛFacebook §Ó §ã§Ú§ã§ä§Ö§Þ? §Ò?§Ò§Ý?§à§ä§Ö§é§ß§Ú§ç ?§ß§ä§Ö§â§ß§Ö§ä-§Ü§à§Þ§å§ß?§Ü§Ñ§è?§Û
Facebook §Ó §ã§Ú§ã§ä§Ö§Þ? §Ò?§Ò§Ý?§à§ä§Ö§é§ß§Ú§ç ?§ß§ä§Ö§â§ß§Ö§ä-§Ü§à§Þ§å§ß?§Ü§Ñ§è?§Û
§´§Ö§â§ß§à§á?§Ý§î§ã§î§Ü§Ñ §à§Ò§Ý§Ñ§ã§ß§Ñ §å§ß?§Ó§Ö§â§ã§Ñ§Ý§î§ß§Ñ §ß§Ñ§å§Ü§à§Ó§Ñ §Ò?§Ò§Ý?§à§ä§Ö§Ü§Ñ
?
Facebook And Academic Libraries
Facebook And Academic LibrariesFacebook And Academic Libraries
Facebook And Academic Libraries
Kerry B
?
Sierra 101 powerpoint
Sierra 101 powerpointSierra 101 powerpoint
Sierra 101 powerpoint
Kerry B
?
X'mas Green Guide a to z
X'mas Green Guide a to zX'mas Green Guide a to z
X'mas Green Guide a to z
Flora Lan
?
Jay Z
Jay  ZJay  Z
Jay Z
guest77fb73
?
patr¨®n Duende amigurumipatr¨®n Duende amigurumi
patr¨®n Duende amigurumi
daxarabalea
?

Similar to Create easymoduleinphpfox (20)

tao module joomla 1.5
tao module  joomla 1.5tao module  joomla 1.5
tao module joomla 1.5
dvms
?
Zend Framework 2.0: Upload file v¨¤ Multi upload files trong ZF2 - B¨¤i 9
Zend Framework 2.0:  Upload file v¨¤ Multi upload files trong ZF2 - B¨¤i 9Zend Framework 2.0:  Upload file v¨¤ Multi upload files trong ZF2 - B¨¤i 9
Zend Framework 2.0: Upload file v¨¤ Multi upload files trong ZF2 - B¨¤i 9
KhanhPham
?
Tailieuonline.tk joomla-viet-component
 Tailieuonline.tk joomla-viet-component Tailieuonline.tk joomla-viet-component
Tailieuonline.tk joomla-viet-component
zzbabyloveszz
?
H??ng d?n l?p tr¨¬nh v?i SCSF ph?n I (smart client software factory)
H??ng d?n l?p tr¨¬nh v?i SCSF ph?n I (smart client software factory)H??ng d?n l?p tr¨¬nh v?i SCSF ph?n I (smart client software factory)
H??ng d?n l?p tr¨¬nh v?i SCSF ph?n I (smart client software factory)
Minh Tri Lam
?
H?i t¨¬nh h¨¬nh bk tiny bktiny-hdsd
H?i t¨¬nh h¨¬nh bk tiny   bktiny-hdsdH?i t¨¬nh h¨¬nh bk tiny   bktiny-hdsd
H?i t¨¬nh h¨¬nh bk tiny bktiny-hdsd
Vu Hung Nguyen
?
[Athena] Nguy?n Nh?t Nguy¨ºn - B¨¢o c¨¢o th?c t?p
[Athena] Nguy?n Nh?t Nguy¨ºn - B¨¢o c¨¢o th?c t?p[Athena] Nguy?n Nh?t Nguy¨ºn - B¨¢o c¨¢o th?c t?p
[Athena] Nguy?n Nh?t Nguy¨ºn - B¨¢o c¨¢o th?c t?p
nnn4194a
?
The First 2015 Saigon WordPress Meetup
The First 2015 Saigon WordPress MeetupThe First 2015 Saigon WordPress Meetup
The First 2015 Saigon WordPress Meetup
KhanhPham
?
H??ng d?n l?p tr¨¬nh v?i SCSF ph?n II(smart client software factory)
H??ng d?n l?p tr¨¬nh v?i SCSF ph?n II(smart client software factory)H??ng d?n l?p tr¨¬nh v?i SCSF ph?n II(smart client software factory)
H??ng d?n l?p tr¨¬nh v?i SCSF ph?n II(smart client software factory)
Minh Tri Lam
?
PHP c¨® th? l¨¤m g¨¬? 9 Th? th¨² v? c¨® th? l¨¤m v?i PHP
PHP c¨® th? l¨¤m g¨¬?  9 Th? th¨² v? c¨® th? l¨¤m v?i PHPPHP c¨® th? l¨¤m g¨¬?  9 Th? th¨² v? c¨® th? l¨¤m v?i PHP
PHP c¨® th? l¨¤m g¨¬? 9 Th? th¨² v? c¨® th? l¨¤m v?i PHP
NIIT - ICT H¨¤ N?i
?
S?c m?nh c?a jsf 2, ph?n 3 x? l? s? ki?n, java script v¨¤ ajax
S?c m?nh c?a jsf 2, ph?n 3 x? l? s? ki?n, java script v¨¤ ajaxS?c m?nh c?a jsf 2, ph?n 3 x? l? s? ki?n, java script v¨¤ ajax
S?c m?nh c?a jsf 2, ph?n 3 x? l? s? ki?n, java script v¨¤ ajax
Tuyet Tam
?
Tai lieu huong_dan_tu_hoc_visual_studio2010
Tai lieu huong_dan_tu_hoc_visual_studio2010Tai lieu huong_dan_tu_hoc_visual_studio2010
Tai lieu huong_dan_tu_hoc_visual_studio2010
Nhat Linh Luong
?
Gi¨¢o tr¨¬nh l?p tr¨¬nh Wordpress - b¨¤i 4 - T?o Plugin c?n b?n
Gi¨¢o tr¨¬nh l?p tr¨¬nh Wordpress - b¨¤i 4 - T?o Plugin c?n b?n Gi¨¢o tr¨¬nh l?p tr¨¬nh Wordpress - b¨¤i 4 - T?o Plugin c?n b?n
Gi¨¢o tr¨¬nh l?p tr¨¬nh Wordpress - b¨¤i 4 - T?o Plugin c?n b?n
KhanhPham
?
Mixing asp.net mvc & web form into hybrid project
Mixing asp.net mvc & web form into hybrid projectMixing asp.net mvc & web form into hybrid project
Mixing asp.net mvc & web form into hybrid project
Minh Tri Lam
?
Asp.net mvc framework qua cac vi du
Asp.net mvc framework  qua cac vi duAsp.net mvc framework  qua cac vi du
Asp.net mvc framework qua cac vi du
Kim Hyun Hai
?
Tutoria mvc framework
Tutoria mvc frameworkTutoria mvc framework
Tutoria mvc framework
Xuan Le
?
Php c? b?n c?a trung t?m hocweb.com.vn
Php c? b?n c?a trung t?m hocweb.com.vnPhp c? b?n c?a trung t?m hocweb.com.vn
Php c? b?n c?a trung t?m hocweb.com.vn
Dang le Nam
?
Tran thikimthao k37103014_wordpress
Tran thikimthao k37103014_wordpressTran thikimthao k37103014_wordpress
Tran thikimthao k37103014_wordpress
T¨ªm Bi?c
?
tao module joomla 1.5
tao module  joomla 1.5tao module  joomla 1.5
tao module joomla 1.5
dvms
?
Zend Framework 2.0: Upload file v¨¤ Multi upload files trong ZF2 - B¨¤i 9
Zend Framework 2.0:  Upload file v¨¤ Multi upload files trong ZF2 - B¨¤i 9Zend Framework 2.0:  Upload file v¨¤ Multi upload files trong ZF2 - B¨¤i 9
Zend Framework 2.0: Upload file v¨¤ Multi upload files trong ZF2 - B¨¤i 9
KhanhPham
?
Tailieuonline.tk joomla-viet-component
 Tailieuonline.tk joomla-viet-component Tailieuonline.tk joomla-viet-component
Tailieuonline.tk joomla-viet-component
zzbabyloveszz
?
H??ng d?n l?p tr¨¬nh v?i SCSF ph?n I (smart client software factory)
H??ng d?n l?p tr¨¬nh v?i SCSF ph?n I (smart client software factory)H??ng d?n l?p tr¨¬nh v?i SCSF ph?n I (smart client software factory)
H??ng d?n l?p tr¨¬nh v?i SCSF ph?n I (smart client software factory)
Minh Tri Lam
?
H?i t¨¬nh h¨¬nh bk tiny bktiny-hdsd
H?i t¨¬nh h¨¬nh bk tiny   bktiny-hdsdH?i t¨¬nh h¨¬nh bk tiny   bktiny-hdsd
H?i t¨¬nh h¨¬nh bk tiny bktiny-hdsd
Vu Hung Nguyen
?
[Athena] Nguy?n Nh?t Nguy¨ºn - B¨¢o c¨¢o th?c t?p
[Athena] Nguy?n Nh?t Nguy¨ºn - B¨¢o c¨¢o th?c t?p[Athena] Nguy?n Nh?t Nguy¨ºn - B¨¢o c¨¢o th?c t?p
[Athena] Nguy?n Nh?t Nguy¨ºn - B¨¢o c¨¢o th?c t?p
nnn4194a
?
The First 2015 Saigon WordPress Meetup
The First 2015 Saigon WordPress MeetupThe First 2015 Saigon WordPress Meetup
The First 2015 Saigon WordPress Meetup
KhanhPham
?
H??ng d?n l?p tr¨¬nh v?i SCSF ph?n II(smart client software factory)
H??ng d?n l?p tr¨¬nh v?i SCSF ph?n II(smart client software factory)H??ng d?n l?p tr¨¬nh v?i SCSF ph?n II(smart client software factory)
H??ng d?n l?p tr¨¬nh v?i SCSF ph?n II(smart client software factory)
Minh Tri Lam
?
PHP c¨® th? l¨¤m g¨¬? 9 Th? th¨² v? c¨® th? l¨¤m v?i PHP
PHP c¨® th? l¨¤m g¨¬?  9 Th? th¨² v? c¨® th? l¨¤m v?i PHPPHP c¨® th? l¨¤m g¨¬?  9 Th? th¨² v? c¨® th? l¨¤m v?i PHP
PHP c¨® th? l¨¤m g¨¬? 9 Th? th¨² v? c¨® th? l¨¤m v?i PHP
NIIT - ICT H¨¤ N?i
?
S?c m?nh c?a jsf 2, ph?n 3 x? l? s? ki?n, java script v¨¤ ajax
S?c m?nh c?a jsf 2, ph?n 3 x? l? s? ki?n, java script v¨¤ ajaxS?c m?nh c?a jsf 2, ph?n 3 x? l? s? ki?n, java script v¨¤ ajax
S?c m?nh c?a jsf 2, ph?n 3 x? l? s? ki?n, java script v¨¤ ajax
Tuyet Tam
?
Tai lieu huong_dan_tu_hoc_visual_studio2010
Tai lieu huong_dan_tu_hoc_visual_studio2010Tai lieu huong_dan_tu_hoc_visual_studio2010
Tai lieu huong_dan_tu_hoc_visual_studio2010
Nhat Linh Luong
?
Gi¨¢o tr¨¬nh l?p tr¨¬nh Wordpress - b¨¤i 4 - T?o Plugin c?n b?n
Gi¨¢o tr¨¬nh l?p tr¨¬nh Wordpress - b¨¤i 4 - T?o Plugin c?n b?n Gi¨¢o tr¨¬nh l?p tr¨¬nh Wordpress - b¨¤i 4 - T?o Plugin c?n b?n
Gi¨¢o tr¨¬nh l?p tr¨¬nh Wordpress - b¨¤i 4 - T?o Plugin c?n b?n
KhanhPham
?
Mixing asp.net mvc & web form into hybrid project
Mixing asp.net mvc & web form into hybrid projectMixing asp.net mvc & web form into hybrid project
Mixing asp.net mvc & web form into hybrid project
Minh Tri Lam
?
Asp.net mvc framework qua cac vi du
Asp.net mvc framework  qua cac vi duAsp.net mvc framework  qua cac vi du
Asp.net mvc framework qua cac vi du
Kim Hyun Hai
?
Tutoria mvc framework
Tutoria mvc frameworkTutoria mvc framework
Tutoria mvc framework
Xuan Le
?
Php c? b?n c?a trung t?m hocweb.com.vn
Php c? b?n c?a trung t?m hocweb.com.vnPhp c? b?n c?a trung t?m hocweb.com.vn
Php c? b?n c?a trung t?m hocweb.com.vn
Dang le Nam
?
Tran thikimthao k37103014_wordpress
Tran thikimthao k37103014_wordpressTran thikimthao k37103014_wordpress
Tran thikimthao k37103014_wordpress
T¨ªm Bi?c
?

Recently uploaded (18)

Cours 3 Les voyelles nasales semi voyelles.pptx
Cours 3 Les voyelles nasales semi voyelles.pptxCours 3 Les voyelles nasales semi voyelles.pptx
Cours 3 Les voyelles nasales semi voyelles.pptx
HaihuyDong
?
GRAMMAR PRACTICE TEST 01 ANSWER KEY.docx
GRAMMAR PRACTICE TEST 01 ANSWER KEY.docxGRAMMAR PRACTICE TEST 01 ANSWER KEY.docx
GRAMMAR PRACTICE TEST 01 ANSWER KEY.docx
AnhDuc498595
?
pppppp.pptxmmmmmmmmmmmmmmmmmoommmmmmmmmmmmmmmmm
pppppp.pptxmmmmmmmmmmmmmmmmmoommmmmmmmmmmmmmmmmpppppp.pptxmmmmmmmmmmmmmmmmmoommmmmmmmmmmmmmmmm
pppppp.pptxmmmmmmmmmmmmmmmmmoommmmmmmmmmmmmmmmm
ngPhan57
?
Gi¨¢o ¨¢n Ng? v?n 10 KNTT B? 2 NG??I C?M QUY?N....docx
Gi¨¢o ¨¢n Ng? v?n 10 KNTT B? 2 NG??I C?M QUY?N....docxGi¨¢o ¨¢n Ng? v?n 10 KNTT B? 2 NG??I C?M QUY?N....docx
Gi¨¢o ¨¢n Ng? v?n 10 KNTT B? 2 NG??I C?M QUY?N....docx
thanhyt004
?
MICE Tr??ng Anh ng? IU Cebu Brochure 2025.pdf
MICE Tr??ng Anh ng? IU Cebu Brochure 2025.pdfMICE Tr??ng Anh ng? IU Cebu Brochure 2025.pdf
MICE Tr??ng Anh ng? IU Cebu Brochure 2025.pdf
Du h?c MICE - Du h?c ti?ng Anh
?
Bac gau den va hai chu tho co NGUYET.ppt
Bac gau den va hai chu tho co NGUYET.pptBac gau den va hai chu tho co NGUYET.ppt
Bac gau den va hai chu tho co NGUYET.ppt
LuPhm10
?
373E879C-764F-11EF-AA2F-F5F8FA70038B.pdf
373E879C-764F-11EF-AA2F-F5F8FA70038B.pdf373E879C-764F-11EF-AA2F-F5F8FA70038B.pdf
373E879C-764F-11EF-AA2F-F5F8FA70038B.pdf
KimAnhDng
?
Nghi¨ºn c?u sinh h?c v? ??t bi?n Nhi?m s?c th?
Nghi¨ºn c?u sinh h?c v? ??t bi?n Nhi?m s?c th?Nghi¨ºn c?u sinh h?c v? ??t bi?n Nhi?m s?c th?
Nghi¨ºn c?u sinh h?c v? ??t bi?n Nhi?m s?c th?
nguyenphuonguyen1412
?
[PPT11] B¨¤i 7 - ??c - C¨¤ Mau qu¨º x?.pptx
[PPT11] B¨¤i 7 - ??c - C¨¤ Mau qu¨º x?.pptx[PPT11] B¨¤i 7 - ??c - C¨¤ Mau qu¨º x?.pptx
[PPT11] B¨¤i 7 - ??c - C¨¤ Mau qu¨º x?.pptx
phuonguyn2400
?
Airport Vocabulary IN ENGLISH BBBHHBHBHBHB
Airport Vocabulary IN ENGLISH BBBHHBHBHBHBAirport Vocabulary IN ENGLISH BBBHHBHBHBHB
Airport Vocabulary IN ENGLISH BBBHHBHBHBHB
HBng40
?
Bac gau den va hai chu tho co NGUYET.ppt
Bac gau den va hai chu tho co NGUYET.pptBac gau den va hai chu tho co NGUYET.ppt
Bac gau den va hai chu tho co NGUYET.ppt
LuPhm10
?
B¨¤i gi?ng TTHCM.pptx B¨¤i gi?ng TTHCMB¨¤i gi?ng TTHCM
B¨¤i gi?ng TTHCM.pptx B¨¤i gi?ng TTHCMB¨¤i gi?ng TTHCMB¨¤i gi?ng TTHCM.pptx B¨¤i gi?ng TTHCMB¨¤i gi?ng TTHCM
B¨¤i gi?ng TTHCM.pptx B¨¤i gi?ng TTHCMB¨¤i gi?ng TTHCM
2251010138
?
cd-van-6_-t47-b4-thtv-tu-dong-am-tu-da-nghia_11072023.pptx
cd-van-6_-t47-b4-thtv-tu-dong-am-tu-da-nghia_11072023.pptxcd-van-6_-t47-b4-thtv-tu-dong-am-tu-da-nghia_11072023.pptx
cd-van-6_-t47-b4-thtv-tu-dong-am-tu-da-nghia_11072023.pptx
ThyLinh936093
?
[PPT11] B¨¤i 7 - ??c - V¨¤ t?i v?n mu?n m?....ppt
[PPT11] B¨¤i 7 - ??c - V¨¤ t?i v?n mu?n m?....ppt[PPT11] B¨¤i 7 - ??c - V¨¤ t?i v?n mu?n m?....ppt
[PPT11] B¨¤i 7 - ??c - V¨¤ t?i v?n mu?n m?....ppt
phuonguyn2400
?
B¨¤i gi?ng LS?.pptx.pptx B¨¤i gi?ng LS?.pptx.pptx
B¨¤i gi?ng LS?.pptx.pptx B¨¤i gi?ng LS?.pptx.pptxB¨¤i gi?ng LS?.pptx.pptx B¨¤i gi?ng LS?.pptx.pptx
B¨¤i gi?ng LS?.pptx.pptx B¨¤i gi?ng LS?.pptx.pptx
2251010138
?
CHINH PH?C L? THUY?T SINH H?C B?NG S? ?? T? DUY.pdf
CHINH PH?C L? THUY?T SINH H?C B?NG S? ?? T? DUY.pdfCHINH PH?C L? THUY?T SINH H?C B?NG S? ?? T? DUY.pdf
CHINH PH?C L? THUY?T SINH H?C B?NG S? ?? T? DUY.pdf
Huyn804581
?
Ch??ng 3. ??i l?u nhi?t. h¨®a h?u c? TDTU
Ch??ng 3.  ??i l?u nhi?t. h¨®a h?u c? TDTUCh??ng 3.  ??i l?u nhi?t. h¨®a h?u c? TDTU
Ch??ng 3. ??i l?u nhi?t. h¨®a h?u c? TDTU
ngKhi80
?
bac-gau-den-va-hai-chu-tho-co-chu_02122022.ppt
bac-gau-den-va-hai-chu-tho-co-chu_02122022.pptbac-gau-den-va-hai-chu-tho-co-chu_02122022.ppt
bac-gau-den-va-hai-chu-tho-co-chu_02122022.ppt
LuPhm10
?
Cours 3 Les voyelles nasales semi voyelles.pptx
Cours 3 Les voyelles nasales semi voyelles.pptxCours 3 Les voyelles nasales semi voyelles.pptx
Cours 3 Les voyelles nasales semi voyelles.pptx
HaihuyDong
?
GRAMMAR PRACTICE TEST 01 ANSWER KEY.docx
GRAMMAR PRACTICE TEST 01 ANSWER KEY.docxGRAMMAR PRACTICE TEST 01 ANSWER KEY.docx
GRAMMAR PRACTICE TEST 01 ANSWER KEY.docx
AnhDuc498595
?
pppppp.pptxmmmmmmmmmmmmmmmmmoommmmmmmmmmmmmmmmm
pppppp.pptxmmmmmmmmmmmmmmmmmoommmmmmmmmmmmmmmmmpppppp.pptxmmmmmmmmmmmmmmmmmoommmmmmmmmmmmmmmmm
pppppp.pptxmmmmmmmmmmmmmmmmmoommmmmmmmmmmmmmmmm
ngPhan57
?
Gi¨¢o ¨¢n Ng? v?n 10 KNTT B? 2 NG??I C?M QUY?N....docx
Gi¨¢o ¨¢n Ng? v?n 10 KNTT B? 2 NG??I C?M QUY?N....docxGi¨¢o ¨¢n Ng? v?n 10 KNTT B? 2 NG??I C?M QUY?N....docx
Gi¨¢o ¨¢n Ng? v?n 10 KNTT B? 2 NG??I C?M QUY?N....docx
thanhyt004
?
Bac gau den va hai chu tho co NGUYET.ppt
Bac gau den va hai chu tho co NGUYET.pptBac gau den va hai chu tho co NGUYET.ppt
Bac gau den va hai chu tho co NGUYET.ppt
LuPhm10
?
373E879C-764F-11EF-AA2F-F5F8FA70038B.pdf
373E879C-764F-11EF-AA2F-F5F8FA70038B.pdf373E879C-764F-11EF-AA2F-F5F8FA70038B.pdf
373E879C-764F-11EF-AA2F-F5F8FA70038B.pdf
KimAnhDng
?
Nghi¨ºn c?u sinh h?c v? ??t bi?n Nhi?m s?c th?
Nghi¨ºn c?u sinh h?c v? ??t bi?n Nhi?m s?c th?Nghi¨ºn c?u sinh h?c v? ??t bi?n Nhi?m s?c th?
Nghi¨ºn c?u sinh h?c v? ??t bi?n Nhi?m s?c th?
nguyenphuonguyen1412
?
[PPT11] B¨¤i 7 - ??c - C¨¤ Mau qu¨º x?.pptx
[PPT11] B¨¤i 7 - ??c - C¨¤ Mau qu¨º x?.pptx[PPT11] B¨¤i 7 - ??c - C¨¤ Mau qu¨º x?.pptx
[PPT11] B¨¤i 7 - ??c - C¨¤ Mau qu¨º x?.pptx
phuonguyn2400
?
Airport Vocabulary IN ENGLISH BBBHHBHBHBHB
Airport Vocabulary IN ENGLISH BBBHHBHBHBHBAirport Vocabulary IN ENGLISH BBBHHBHBHBHB
Airport Vocabulary IN ENGLISH BBBHHBHBHBHB
HBng40
?
Bac gau den va hai chu tho co NGUYET.ppt
Bac gau den va hai chu tho co NGUYET.pptBac gau den va hai chu tho co NGUYET.ppt
Bac gau den va hai chu tho co NGUYET.ppt
LuPhm10
?
B¨¤i gi?ng TTHCM.pptx B¨¤i gi?ng TTHCMB¨¤i gi?ng TTHCM
B¨¤i gi?ng TTHCM.pptx B¨¤i gi?ng TTHCMB¨¤i gi?ng TTHCMB¨¤i gi?ng TTHCM.pptx B¨¤i gi?ng TTHCMB¨¤i gi?ng TTHCM
B¨¤i gi?ng TTHCM.pptx B¨¤i gi?ng TTHCMB¨¤i gi?ng TTHCM
2251010138
?
cd-van-6_-t47-b4-thtv-tu-dong-am-tu-da-nghia_11072023.pptx
cd-van-6_-t47-b4-thtv-tu-dong-am-tu-da-nghia_11072023.pptxcd-van-6_-t47-b4-thtv-tu-dong-am-tu-da-nghia_11072023.pptx
cd-van-6_-t47-b4-thtv-tu-dong-am-tu-da-nghia_11072023.pptx
ThyLinh936093
?
[PPT11] B¨¤i 7 - ??c - V¨¤ t?i v?n mu?n m?....ppt
[PPT11] B¨¤i 7 - ??c - V¨¤ t?i v?n mu?n m?....ppt[PPT11] B¨¤i 7 - ??c - V¨¤ t?i v?n mu?n m?....ppt
[PPT11] B¨¤i 7 - ??c - V¨¤ t?i v?n mu?n m?....ppt
phuonguyn2400
?
B¨¤i gi?ng LS?.pptx.pptx B¨¤i gi?ng LS?.pptx.pptx
B¨¤i gi?ng LS?.pptx.pptx B¨¤i gi?ng LS?.pptx.pptxB¨¤i gi?ng LS?.pptx.pptx B¨¤i gi?ng LS?.pptx.pptx
B¨¤i gi?ng LS?.pptx.pptx B¨¤i gi?ng LS?.pptx.pptx
2251010138
?
CHINH PH?C L? THUY?T SINH H?C B?NG S? ?? T? DUY.pdf
CHINH PH?C L? THUY?T SINH H?C B?NG S? ?? T? DUY.pdfCHINH PH?C L? THUY?T SINH H?C B?NG S? ?? T? DUY.pdf
CHINH PH?C L? THUY?T SINH H?C B?NG S? ?? T? DUY.pdf
Huyn804581
?
Ch??ng 3. ??i l?u nhi?t. h¨®a h?u c? TDTU
Ch??ng 3.  ??i l?u nhi?t. h¨®a h?u c? TDTUCh??ng 3.  ??i l?u nhi?t. h¨®a h?u c? TDTU
Ch??ng 3. ??i l?u nhi?t. h¨®a h?u c? TDTU
ngKhi80
?
bac-gau-den-va-hai-chu-tho-co-chu_02122022.ppt
bac-gau-den-va-hai-chu-tho-co-chu_02122022.pptbac-gau-den-va-hai-chu-tho-co-chu_02122022.ppt
bac-gau-den-va-hai-chu-tho-co-chu_02122022.ppt
LuPhm10
?

Create easymoduleinphpfox

  • 1. C¨¢ch t?o m?t module ??n gi?n tr¨ºn phpfox ? b¨¤i vi?t n¨¤y, t?i s? tr¨¬nh b¨¤y m?t c¨¢ch chi ti?t c¨¢c b??c x?y d?ng m?t module ??n gi?n tr¨ºn c?ng c? phpfox. Ch¨²ng ta s? ti?p c?n b?ng c¨¢ch th?c hi?n m?t v¨ª d? c? th?, c¨¢c b?n c¨® th? ¨¢p d?ng nh?ng chi ti?t trong v¨ª d? n¨¤y ?? ¨¢p d?ng cho nh?ng project c?a c¨¢c b?n. ?? b¨¤i: Vi?t m?t module tr¨ºn phpfox t?o m?t user v¨¤ insert th?ng tin user ?¨® v¨¤o c? s? d? li?u, ??ng th?i hi?n th? th?ng tin user v?a t?o tr¨ºn m?t menu ? AdminCP. C¨¢ch th?c hi?n: Phi¨ºn b?n s? d?ng: phpfox 3.5.1 B?n c¨® th? download phpfox t?i ??y. H??ng d?n c¨¤i ??t phpfox b?n c¨® th? tham kh?o ? ??y. Create a new product ??u ti¨ºn b?n s? t?o m?t product m?i (n?i ch?a module c?a b?n). Tuy nhi¨ºn, ??y ch? l¨¤ b??c t¨´y ch?n v¨¬ b?n c¨® th? ??t module c?a m¨¬nh v¨¤o m?t product b?t k¨¬ c¨® s?n tr¨ºn phpfox. M?c d¨´ v?y, vi?c s? d?ng m?t product ri¨ºng c?a b?n th?n s? gi¨²p b?n c¨® th? t¨´y bi?n d? d¨¤ng nh?ng ch?c n?ng trong n¨®. C¨¢c b??c ?? t?o m?t product m?i nh? sau: ??ng nh?p v?i t¨¤i kho?n AdminCP v¨¤ truy nh?p ???ng d?n sau: Extensions >> Product >> Create New Product ?i?n ??y ?? c¨¢c th?ng tin v¨¤o form v¨¤ click n¨²t submit: D??i ??y t?i s? gi?i th¨ªch chi ti?t th?ng tin c?a t?ng tr??ng:
  • 2. ? ? ? ? ? ? ? Product ID: gi¨¢ tr? ID duy nh?t c?a product. N¨® c¨® th? l¨¤ k¨ª t? s?, ch? c¨¢i v¨¤ d?u g?ch d??i (_), v¨¤ lu?n ? d?ng ch? c¨¢i th??ng. ? ??y t?i s? ch?n l¨¤ create_user. Title: ti¨ºu ?? c?a product, th? m¨¤ s? hi?n th? trong danh s¨¢ch c¨¢c product. ? ??y t?i s? ch?n l¨¤ Create new user. Description: m? t? ng?n v? product. ? ??y t?i s? ch?n l¨¤ Create a new user manually. Version: phi¨ºn b?n hi?n t?i c?a product. Do t?i m?i t?o product n¨¤y n¨ºn t?i s? ch?n l¨¤ 1.0. Product URL: URL c?a website c?a b?n, ? ??y t?i s? d?ng localhost n¨ºn s? ?i?n l¨¤: localhost. Version Check URL: URL ?? phpfox ki?m tra phi¨ºn b?n release c?a product. ? ??y t?i ?i?n l¨¤ localhost/version.php. Active: thi?t l?p tr?ng th¨¢i c?a product l¨¤ active ho?c inactive. Ch?n Yes. Create new module in AdminCP ??ng nh?p v¨¤o AdminCP v¨¤ v¨¤o theo ???ng d?n: Extension >> Module >> Create New Module Ti?p theo ch¨²ng ta s? ?i?n ??y ?? v¨¤o form d??i ??y v¨¤ click n¨²t submit: Chi ti?t th?ng tin c?a t?ng tr??ng: ? ? ? ? Product: t¨ºn c?a product ch?a module c?a b?n. ? ??y t?i s? chon l¨¤ Create new user. Module ID: id c?a module. ? ??y t?i ch?n l¨¤ createuser. Add to Menu: ch?n Yes ?? module c?a b?n xu?t hi?n trong Module menu. Sub Menu: Khi b?n ch?n Yes ? ph?n Add to Menu, b?n s? b?t bu?c ph?i ?i?n th?ng tin ? m?c Sub Menu n¨¤y. ? ??y ch¨²ng ta s? ??nh ngh?a t¨ºn c?a c¨¢c sub menu v¨¤ URL t??ng ?ng. T?i s? t?o 2 sub menu: Show info ?? hi?n th? th?ng tin ng??i d¨´ng, v?i link createuser ???c hi?u l¨¤ ???ng d?n http://localhost/phpFox-3.5.1/upload/index.php?do=/admincp/createuser/; Add new t?o form ?? ?i?n th?ng tin ng??i d¨´ng v¨¤ insert th?ng tin ?¨® v¨¤o c? s? d? li?u, v?i link createuser.add ??i
  • 3. ? di?n cho ???ng d?n http://localhost/phpFox3.5.1/upload/index.php?do=/admincp/createuser/add/. Info: M? t? ng?n v? module. ? ??y t?i ch?n l¨¤ Admin can create a new user manually!. Build file structure D?n ??n folder /module/ tr¨ºn server c?a b?n n?i ch?a file c¨¤i ??t c?a phpfox. T?o m?t folder m?i v?i t¨ºn c?a module m¨¤ b?n v?a t?o, c?a t?i l¨¤ createuser. B¨ºn trong folder m?i b?n s? t?o theo c?u tr¨²c sau: /include/ /include/component/ /include/component/ajax/ /include/component/block/ /include/component/controller/ /include/component/controller/admincp /include/plugin/ /include/service/ /static/ /static/css/default/default/ /static/image/ /static/jscript/ /template/ /template/default/ /template/default/block/ /template/default/controller/ /template/default/controller/admincp Ch¨² ? r?ng ??y l¨¤ c?u tr¨²c file d?ng ??y ?? c?a m?t module, v¨¬ v?y t¨´y v¨¤o m?c ?¨ªch c?a b?n m¨¤ b?n c¨® th? ch? c?n t?o m?t s? th? m?c c?n thi?t. Create a controller Controller l¨¤ nh?ng file php ?i?u khi?n t?t c? c¨¢c page c?a phpfox. ??u ti¨ºn h?y t?o m?t php class file cho controller c?a ch¨²ng ta: /module/createuser/include/component/controller/admincp/index.class.ph p N?i dung c?a file index.class.php nh? sau: index.class.php <?php class Createuser_Component_Controller_Admincp_Index extends Phpfox_Component { public function process() { } }
  • 4. ?> Ti?p theo ch¨²ng ta s? t?o m?t file HTML cho controller v?a t?o c?a ch¨²ng ta: modulecreateusertemplatedefaultcontrolleradmincpindex.html.php Trong file index.html.php, b?n c¨® th? th¨ºm d¨°ng sau ?? ki?m tra t¨ªnh k?t n?i gi?a file controller v¨¤ html m¨¤ b?n v?a t?o. index.html.php Helloworld! Truy nh?p v¨¤o ???ng d?n sau: http://localhost/phpFox-3.5.1/upload/index.php?do=/admincp/createuser/ Ho?c truy nh?p v¨¤o AdminCP v¨¤ ?i theo ???ng d?n: Module >> Createuser >> Show info ??y l¨¤ k?t qu? thu ???c: Gi?i th¨ªch chi ti?t: T¨ºn l?p trong file index.class.php l¨¤: Createuser_Component_Controller_Admincp_Index N?u thay d?u g?ch d??i (_) b?ng d?u g?ch tr¨¢i (/) th¨¬ n¨® s? nh?c b?n t?i ???ng d?n ??n file index.class.php c?a ch¨²ng ta: /module/createuser/include/component/controller/admincp/index.class.ph p L?p n¨¤y s? k? th?a t? l?p Phpfox_Component, l? do l¨¤ n¨® n?m trong th? m?c Component. ?? th?c thi ???c controller n¨¤y, ta c?n cung c?p ph??ng th?c public process(). C¨¢i t¨ºn index ? ??y l¨¤ b?t bu?c khi b?n mu?n d?n ??n module g?c ? ???ng link: http://localhost/phpFox-3.5.1/upload/index.php?do=/admincp/createuser/
  • 5. Ti?p theo ch¨²ng ta s? t?o file add.class.php, ??y s? l¨¤ controller c?a ???ng d?n: http://localhost/phpFox-3.5.1/upload/index.php?do=/admincp/createuser/add/ V¨¤ t?t nhi¨ºn b?n v?n s? ph?i t?o m?t file html t??ng ?ng (add.html.php) ? th? m?c modulecreateusertemplatedefaultcontrolleradmincp ?? hi?n th? th?ng tin c?n thi?t. Ta s? x?y d?ng form trong add.html.php ?? nh?p th?ng tin user c?n t?o. ??y l¨¤ d?ng form m¨¤ t?i ?? t?o. V¨¤ d??i ??y l¨¤ ?o?n code t??ng ?ng: add.html.php <html> <body> <form action="{url link='admincp.createuser.index'}" method="post" id="add_new_user"> <div class="user_create"> <div class="table_header"> User Infomation </div> <div class="table"> <div class="table_left"> {required}Full name: </div> <div class="table_right"> <input type="text" name="full_name" size="40" value="yourname" /> </div> </div> <div class="table"> <div class="table_left"> {required}Email: </div> <div class="table_right"> <input type="text" name="email" size="40" value="someone@example.com" required /> </div> </div>
  • 6. <div class="table"> <div class="table_left"> {required}Password: </div> <div class="table_right"> <input type="password" name="password" size="40" value="" required/> </div> </div> <div class="table"> <div class="table_left"> {required}Birthday: </div> <div class="table_right"> <select name="month"> <option value="">Month: </option> {foreach from=$months item=month} <option value={$i++}>{$month}</option> {/foreach} </select> / <select name="day"> <option value="">Day: </option> {foreach from=$days item=day} <option value={$day}>{$day}</option> {/foreach} </select> / <select name="year"> <option value="">Year: </option> {foreach from=$years item=year} <option value={$year}>{$year}</option> {/foreach} </select> </div> </div> <div class="table"> <div class="table_left"> {required}I am: </div> <div class="table_right"> <select name="gender"> <option value="">Select: </option> <option value="1">Male</option> <option value="2">Female</option> </select> </div> </div> <div class="table_clear"> <input type="submit" value="{phrase var='core.submit'}" class="button" name="submit" />
  • 7. </div> </div> </form> </body> </html> Gi?i th¨ªch code: Action ? form l¨¤: action="{url link='admincp.createuser.index'}" Link 'admincp.createuser.index¡¯ c¨® d?ng ¡®[admincp.]module_name.file_name_prefix¡¯, ph?n admincp. c¨® th? c¨® ho?c kh?ng t¨´y thu?c v¨¤o vi?c module th?c hi?n tr¨ºn admincp hay tr¨ºn site th?ng th??ng. ? ngh?a l¨¤ form n¨¤y sau khi click submit s? th?c hi?n ?o?n code trong file index.class.php v¨¤ index.html.php. C¨¢c th? div ? ??y t?i c¨® s? d?ng c¨¢c class ???c ??nh ngh?a s?n trong phpfox ?? ??ng nh?t v?i nh?ng form c?a c¨¢c module kh¨¢c. Th?ng tin v? c¨¢c class n¨¤y b?n c¨® th? xem trong c¨¢c file html n?m trong c¨¢c module c¨® s?n c?a phpfox. T? {required} thay th? cho d?u * m¨¤u ??. Ti?p theo l¨¤ m?t v¨°ng l?p kh¨¢ ??c bi?t: {foreach from=$months item=month}...{/foreach} V¨°ng l?p n¨¤y c¨® ngh?a l¨¤ duy?t t?t c? c¨¢c ph?n t? trong m?ng $months, m?i ph?n t? s? ???c ??i di?n b?i bi?n $month. Trong PHP, v¨°ng l?p n¨¤y s? ???c vi?t l?i nh? sau: foreach($months as $month){} C?u h?i l¨¤ m?ng $months n¨¤y ???c l?y t? ??u ra? Th?c ra m?ng $month ???c g¨¢n trong file add.class.php. N?i dung file add.class.php nh? sau: add.class.php <?php class Createuser_Component_Controller_Admincp_Add extends Phpfox_Component{ public function process() { $month = array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'); $day = array(); $year = array(); for ($i = 1; $i < 32; $i++) { $day[] = $i; } for ($j = 1900; $j < 2015; $j++) { $year[] = $j; } $this->template()->assign(array( 'months' => $month, 'days' => $day, 'years' => $year )); }
  • 8. } ?> B?i v¨¬ ?o?n m? c?a ch¨²ng ta s? d?ng m? h¨¬nh MVC, t?c l¨¤ logic PHP trong file class t¨¢ch bi?t v?i logic thi?t k? trong file html, v¨¬ v?y c¨¢c th?ng tin trong file class s? ???c g¨¢n v¨¤o c¨¢c bi?n ?? s? d?ng trong file html. Phpfox cung c?p ph??ng th?c assign() c¨® trong l?p Phpfox_Template ?? th?c hi?n ph¨¦p g¨¢n n¨¤y. Hi?n th? th?ng tin ng??i d¨´ng tr¨ºn menu Show info Menu Show info c¨® url d?n ??n module g?c http://localhost/phpFox3.5.1/upload/index.php?do=/admincp/createuser/. Do ?¨® ta s? x?y d?ng giao di?n cho menu n¨¤y qua file index.html.php v¨¤ ?i?u khi?n b?ng controller index.class.php. N?i dung file index.html.php: index.html.php <html> <div class="table_header"> Show user info </div> <div class="table"> <div class="table_left"> Name: </div> <div class="table_right"> {$fulname} </div> </div> <div class="table"> <div class="table_left"> Email: </div> <div class="table_right"> {$email} </div> </div> <div class="table"> <div class="table_left"> Birthday: </div> <div class="table_right"> {$birthday} </div> </div> <div class="table"> <div class="table_left"> Gender: </div> <div class="table_right"> {$gender} </div>
  • 9. </div> </html> C¨¢c bi?n c?n l?y ? ??y l¨¤ $fulname, $email, $birthday, $gender. Nh?ng bi?n n¨¤y s? ???c l?y b?ng m?ng $_POST th?ng qua form ???c x?y d?ng ? file add.html.php. N?i dung c?a file index.class.php: index.class.php <?php class Createuser_Component_Controller_Admincp_Index extends Phpfox_Component { public function process() { $this->template()->assign(array( 'fulname' => $_POST['full_name'], 'email' => $_POST['email'], 'password' => md5($_POST['password']), 'birthday' => $month . $_POST['day'] . $_POST['year'], 'gender' => $_POST['gender'] )); } } ?> ??n ??y ta s? test th? vi?c hi?n th? th?ng tin ng??i d¨´ng. Truy nh?p theo ???ng d?n http://localhost/phpFox-3.5.1/upload/index.php?do=/admincp/createuser/add/ ho?c ??ng nh?p v¨¤o AdminCP, truy nh?p v¨¤o ???ng d?n Module ? Createuser ? Add new, nh?p ??y ?? th?ng tin v¨¤o form sau: Click Submit v¨¤ h? th?ng s? t? ??ng ?i?u h??ng ??n link http://localhost/phpFox3.5.1/upload/index.php?do=/admincp/createuser/index/:
  • 10. Insert th?ng tin ng??i d¨´ng v¨¤o c? s? d? li?u ?? truy nh?p v¨¤ th?c hi?n c¨¢c ph??ng th?c l¨ºn c? s? d? li?u, t?i s? t?o m?t service extends t? Phpfox_Service. File service n¨¤y n?m tr¨ºn ???ng d?n: modulecreateuserincludeservicecreateuser.class.php Phpfox quy ??nh m?i module ch? c¨® m?t service duy nh?t ?? thao t¨¢c v?i c? s? d? li?u v¨¤ ch? c¨® t¨ºn d?ng module_name.class.php. N?i dung c?a file createuser.class.php: createuser.class.php <?php class Createuser_Service_Createuser extends Phpfox_Service { public function insert_user() { $month = $_POST['month']; switch ($month) { case 'January': $month = '01'; break; case 'February': $month = '02'; break; case 'March': $month = '03'; break; case 'April': $month = '04'; break; case 'May': $month = '05'; break; case 'June': $month = '06'; break; case 'July': $month = '07'; break; case 'August': $month = '08'; break; case 'September': $month = '09'; break; case 'October': $month = 10; break; case 'November': $month = 11; break; case 'December': $month = 12; break; } $insert = Phpfox::getLib('database')->insert('phpfox_user', array(
  • 11. 'user_group_id' => '2', 'full_name' => $_POST['full_name'], 'email' => $_POST['email'], 'password' => md5($_POST['password']), 'birthday' => $month . $_POST['day'] . $_POST['year'], 'gender' => $_POST['gender'] )); return $insert; } } ?> T¨ºn l?p v?n tu?n th? theo ??nh d?ng ???c ??nh ngh?a ? tr¨ºn. Do gi¨¢ tr? $month ban ??u ? d?ng ch? m¨¤ kh?ng ph?i d?ng s?, trong khi d?ng hi?n th? birthday trong c? s? d? li?u l¨¤ mmddyyyy, n¨ºn ta s? chuy?n gi¨¢ tr? $month t? d?ng ch? sang d?ng s? cho ph¨´ h?p. C¨® 2 c¨¢ch ?? th?c hi?n insert v¨¤o c? s? d? li?u: $this¡údatabase()¡úinsert(¡®table_name¡¯, array(¡®collumn_name_1¡¯ =>¡®value_1¡¯, ¡®collumn_name_2¡¯ => ¡®value_2¡¯, ¡­)); Phpfox::getLib('database')->insert(¡®table_name¡¯, array(¡®collumn_name_1¡¯ =>¡®value_1¡¯, ¡®collumn_name_2¡¯ => ¡®value_2¡¯, ¡­)); ? ?¨® column_name_i l¨¤ t¨ºn c?t th? i, c¨°n value_i l¨¤ gi¨¢ tr? c?a c?t t??ng ?ng. Ti?p theo ch¨²ng ta s? th?c thi service n¨¤y. Y¨ºu c?u l¨¤ click n¨²t Submit th¨¬ service n¨¤y c?ng ???c th?c thi, n¨ºn ta s? th?c hi?n vi?c th?c thi n¨¤y trong ph??ng th?c process c?a file index.class.php. Ch¨²ng ta s? th¨ºm ?o?n code sau trong file index.class.php. Phpfox::getService('createuser')->insert_user(); Ph??ng th?c getService nh?n tham s? l¨¤ t¨ºn module v¨¤ g?i ??n ph??ng th?c insert_user() ?? th?c hi?n vi?c insert th?ng tin ng??i d¨´ng v¨¤o c? s? d? li?u. Test Ch¨²ng ta s? th?c hi?n test v?i ng??i d¨´ng John Adam ? tr¨ºn. ??y l¨¤ ?nh c? s? d? li?u tr??c khi click n¨²t Submit.
  • 12. Sau khi click n¨²t Submit. Ch¨² ?: Do ? ??y t?i th?c hi?n tr¨ºn localhost n¨ºn c¨¢c ???ng d?n ??u b?t ??u b?ng localhost, n?u b?n t?o module tr¨ºn server c?a b?n, h?y thay localhost b?ng t¨ºn site c?a b?n trong c¨¢c ???ng d?n m¨¤ t?i ??a ra.