SlideShare une entreprise Scribd logo
1  sur  23
Télécharger pour lire hors ligne
Bài 5
Hướng dẫn xây dựng Extension
Nhắc lại bài cũ
• Chỉnh sửa template thông qua chỉnh sửa hình ảnh, chỉnh
sửa CSS
• Cấu trúc file và thư mục của một Template
Bài 5 - Hướng dẫn xây dựng Extension
Mục tiêu bài học
• Hiểu rõ cấu trúc của component; module
• Hiểu rõ về quy trình, cách thức, giải pháp xây dựng
component, module
Bài 5 - Hướng dẫn xây dựng Extension
Xây dựng Component
Xây dựng component theo mô hình MVC
- Các component Joomla được xây dựng theo mô hình MVC
(Model-View-Controler);
User
(Khách truy
cập web)
Bài 5 - Hướng dẫn xây dựng Extension
View
(tạo giao diện hiển
thị)
Model
(thiết lập các
chức năng web)
Controler
(điều khiển, xử lý
tương tác)
Xây dựng Component
Xây dựng 1 Component đơn giản: Component Hello
Bài 5 - Hướng dẫn xây dựng Extension
Xây dựng Component
Component cơ bản có 5 file:
• site/hello.php - file tạo entry point
• site/controller.php - Thiết lập điều khiển
• site/views/hello/view.html.php - Thiết lập
hiển thị
• site/views/hello/tmpl/default.php - Tạo giao
diện hiển thị
• hello.xml - Đóng gói thành bộ cài
Bài 5 - Hướng dẫn xây dựng Extension
• site/hello.php - file tạo entry point
• site/controller.php - Thiết lập điều khiển
• site/views/hello/view.html.php - Thiết lập
hiển thị
• site/views/hello/tmpl/default.php - Tạo giao
diện hiển thị
• hello.xml - Đóng gói thành bộ cài
Xây dựng Component
Lập trình file Hello.php - Tạo entry point
<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
require_once( JPATH_COMPONENT.DS.'controller.php' );
if ($controller = JRequest::getWord('controller')) {
$path = JPATH_COMPONENT.DS.'controllers'.DS.$controller.'.php';
if (file_exists($path)) {
require_once $path;
} else {
$controller = '';
}
}
$classname = 'HelloController'.$controller;
$controller = new $classname();
$controller->execute( JRequest::getVar( 'task' ) );
$controller->redirect();
Bài 5 - Hướng dẫn xây dựng Extension
<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
require_once( JPATH_COMPONENT.DS.'controller.php' );
if ($controller = JRequest::getWord('controller')) {
$path = JPATH_COMPONENT.DS.'controllers'.DS.$controller.'.php';
if (file_exists($path)) {
require_once $path;
} else {
$controller = '';
}
}
$classname = 'HelloController'.$controller;
$controller = new $classname();
$controller->execute( JRequest::getVar( 'task' ) );
$controller->redirect();
Xây dựng Component
Tạo controller với file controller.php
<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport('joomla.application.component.controller');
class HelloController extends JController
{
function display()
{
parent::display();
}
}
Bài 5 - Hướng dẫn xây dựng Extension
<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport('joomla.application.component.controller');
class HelloController extends JController
{
function display()
{
parent::display();
}
}
Xây dựng Component
Tạo view - lập trình file site/views/hello/view.html.php
<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport( 'joomla.application.component.view');
class HelloViewHello extends JView
{
function display($tpl = null)
{
$greeting = "Hello, World!";
$this->assignRef( 'greeting', $greeting );
parent::display($tpl);
}
}
Bài 5 - Hướng dẫn xây dựng Extension
<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport( 'joomla.application.component.view');
class HelloViewHello extends JView
{
function display($tpl = null)
{
$greeting = "Hello, World!";
$this->assignRef( 'greeting', $greeting );
parent::display($tpl);
}
}
Xây dựng Component
Tạo Template tại file site/views/hello/tmpl/default.php
<?php defined('_JEXEC') or die('Restricted access'); ?>
<h1><?php echo $this->greeting; ?></h1>
Bài 5 - Hướng dẫn xây dựng Extension
Xây dựng Component
Viết file XML (install.xml)
<?xml version="1.0" encoding="utf-8"?>
<install type="component" version="1.5.0">
<name>Hello</name>
<creationDate>2007-02-22</creationDate>
<author>John Doe</author>
<authorEmail>john.doe@example.org</authorEmail>
<authorUrl>http://www.example.org</authorUrl>
<copyright>Copyright Info</copyright>
<license>License Info</license>
<version>1.01</version>
<description>Description of the component ...</description>
<files folder="site">
<filename>controller.php</filename>
<filename>hello.php</filename>
<filename>index.html</filename>
<filename>views/index.html</filename>
<filename>views/hello/index.html</filename>
<filename>views/hello/view.html.php</filename>
<filename>views/hello/tmpl/default.php</filename>
<filename>views/hello/tmpl/index.html</filename>
</files>
Bài 5 - Hướng dẫn xây dựng Extension
<?xml version="1.0" encoding="utf-8"?>
<install type="component" version="1.5.0">
<name>Hello</name>
<creationDate>2007-02-22</creationDate>
<author>John Doe</author>
<authorEmail>john.doe@example.org</authorEmail>
<authorUrl>http://www.example.org</authorUrl>
<copyright>Copyright Info</copyright>
<license>License Info</license>
<version>1.01</version>
<description>Description of the component ...</description>
<files folder="site">
<filename>controller.php</filename>
<filename>hello.php</filename>
<filename>index.html</filename>
<filename>views/index.html</filename>
<filename>views/hello/index.html</filename>
<filename>views/hello/view.html.php</filename>
<filename>views/hello/tmpl/default.php</filename>
<filename>views/hello/tmpl/index.html</filename>
</files>
Xây dựng Component
<administration>
<menu>Hello World!</menu>
<files folder="admin">
<filename>hello.php</filename>
<filename>index.html</filename>
</files>
</administration>
</install>
Bài 5 - Hướng dẫn xây dựng Extension
<administration>
<menu>Hello World!</menu>
<files folder="admin">
<filename>hello.php</filename>
<filename>index.html</filename>
</files>
</administration>
</install>
Xây dựng Component
Tạo file index.html để bảo mật
<html><body bgcolor="#FFFFFF"></body></html>
Bài 5 - Hướng dẫn xây dựng Extension
Xây dựng Component
Bổ xung Model tại site/models/hello.php
<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport( 'joomla.application.component.model' );
class HelloModelHello extends JModel
{
function getGreeting()
{
return 'Hello, World!';
}
}Bài 5 - Hướng dẫn xây dựng Extension
<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport( 'joomla.application.component.model' );
class HelloModelHello extends JModel
{
function getGreeting()
{
return 'Hello, World!';
}
}
Xây dựng Component
Sử dụng Model: bằng cách thay đổi tại dòng $greeting =
"Hello World!"; tại file site/views/hello/view.html.php
<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport( 'joomla.application.component.view');
class HelloViewHello extends JView
{
function display($tpl = null)
{
$model =& $this->getModel();
$greeting = $model->getGreeting();
$this->assignRef( 'greeting', $greeting );
parent::display($tpl);
}
}Bài 5 - Hướng dẫn xây dựng Extension
<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport( 'joomla.application.component.view');
class HelloViewHello extends JView
{
function display($tpl = null)
{
$model =& $this->getModel();
$greeting = $model->getGreeting();
$this->assignRef( 'greeting', $greeting );
parent::display($tpl);
}
}
Xây dựng Component
Bổ sung file vào gói cài đặt bằng dòng lệnh
<filename>models/hello.php</filename>
<files folder="site">
<filename>controller.php</filename>
<filename>hello.php</filename>
<filename>index.html</filename>
<filename>models/hello.php</filename>
<filename>models/index.html</filename>
<filename>views/index.html</filename>
<filename>views/hello/index.html</filename>
<filename>views/hello/view.html.php</filename>
<filename>views/hello/tmpl/default.php</filename>
<filename>views/hello/tmpl/index.html</filename>
</files>
Bài 5 - Hướng dẫn xây dựng Extension
<files folder="site">
<filename>controller.php</filename>
<filename>hello.php</filename>
<filename>index.html</filename>
<filename>models/hello.php</filename>
<filename>models/index.html</filename>
<filename>views/index.html</filename>
<filename>views/hello/index.html</filename>
<filename>views/hello/view.html.php</filename>
<filename>views/hello/tmpl/default.php</filename>
<filename>views/hello/tmpl/index.html</filename>
</files>
Xây dựng Module
Cấu trúc các file trong 1 module:
• mod_helloworld.php
• mod_helloworld.xml
• helper.php
• tmpl/default.php
Bài 5 - Hướng dẫn xây dựng Extension
• mod_helloworld.php
• mod_helloworld.xml
• helper.php
• tmpl/default.php
Xây dựng Module
File mod_helloworld.php
<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
require_once( dirname(__FILE__).DS.'helper.php' );
$hello = modHelloWorldHelper::getHello( $params );
require( JModuleHelper::getLayoutPath( 'mod_helloworld' ) );
?>
Bài 5 - Hướng dẫn xây dựng Extension
<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
require_once( dirname(__FILE__).DS.'helper.php' );
$hello = modHelloWorldHelper::getHello( $params );
require( JModuleHelper::getLayoutPath( 'mod_helloworld' ) );
?>
Xây dựng Module
File helper.php
<?php
class modHelloWorldHelper
{
function getHello( $params )
{
return 'Hello, World!';
}
}
?>
Bài 5 - Hướng dẫn xây dựng Extension
<?php
class modHelloWorldHelper
{
function getHello( $params )
{
return 'Hello, World!';
}
}
?>
Xây dựng Module
File tmpl/defalt.php
<?php // no direct access
defined( '_JEXEC' ) or die( 'Restricted access' ); ?>
<?php echo $hello; ?>
Bài 5 - Hướng dẫn xây dựng Extension
Xây dựng Module
File mod_hello_world.xml
<?xml version="1.0" encoding="utf-8"?>
<install type="module" version="1.5.0">
<name>Hello, World!</name>
<author>John Doe</author>
<version>1.5.0</version>
<description>A simple Hello, World! module.</description>
<files>
<filename>mod_helloworld.xml</filename>
<filename module="mod_helloworld">mod_helloworld.php</filename>
<filename>index.html</filename>
<filename>helper.php</filename>
<filename>tmpl/default.php</filename>
<filename>tmpl/index.html</filename>
</files>
<params>
</params>
</install>
Bài 5 - Hướng dẫn xây dựng Extension
<?xml version="1.0" encoding="utf-8"?>
<install type="module" version="1.5.0">
<name>Hello, World!</name>
<author>John Doe</author>
<version>1.5.0</version>
<description>A simple Hello, World! module.</description>
<files>
<filename>mod_helloworld.xml</filename>
<filename module="mod_helloworld">mod_helloworld.php</filename>
<filename>index.html</filename>
<filename>helper.php</filename>
<filename>tmpl/default.php</filename>
<filename>tmpl/index.html</filename>
</files>
<params>
</params>
</install>
Xây dựng Module
Tạo file index.html trong các thư mục của module để
bảo mật với nội dung:
<html><body bgcolor="#FFFFFF"></body></html>
Bài 5 - Hướng dẫn xây dựng Extension
Tổng kết bài học
• Các component trong Joomla được xây dựng theo mô
hình MVC và dựa vào Joomla Framework - thư viện mã
nguồn sẵn có trong Joomla CMS.
• Quy trình xây dựng giống nhau đối với tất cả các
component hay module.
• Sau khi hoàn thiện lập trình một component hay module,
cần đóng gói thành file .zip để có thể cài đặt vào Joomla
từ trình cài đặt tháo gỡ tự động của Joomla
• Các component trong Joomla được xây dựng theo mô
hình MVC và dựa vào Joomla Framework - thư viện mã
nguồn sẵn có trong Joomla CMS.
• Quy trình xây dựng giống nhau đối với tất cả các
component hay module.
• Sau khi hoàn thiện lập trình một component hay module,
cần đóng gói thành file .zip để có thể cài đặt vào Joomla
từ trình cài đặt tháo gỡ tự động của Joomla
Bài 5 - Hướng dẫn xây dựng Extension

Contenu connexe

Tendances

The First 2015 Saigon WordPress Meetup
The First 2015 Saigon WordPress MeetupThe First 2015 Saigon WordPress Meetup
The First 2015 Saigon WordPress MeetupKhanhPham
 
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 2KhanhPham
 
Bài 3 Lập trình PHP (phần 1) - Giáo trình FPT
Bài 3 Lập trình PHP (phần 1) - Giáo trình FPTBài 3 Lập trình PHP (phần 1) - Giáo trình FPT
Bài 3 Lập trình PHP (phần 1) - Giáo trình FPTMasterCode.vn
 
Wp hoi-thao-phan-quyen
Wp hoi-thao-phan-quyenWp hoi-thao-phan-quyen
Wp hoi-thao-phan-quyenKhanhPham
 
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 FPTMasterCode.vn
 
Mysql Workbench hướng dẫn cài đặt - Video tiếng Việt
Mysql Workbench hướng dẫn cài đặt - Video tiếng ViệtMysql Workbench hướng dẫn cài đặt - Video tiếng Việt
Mysql Workbench hướng dẫn cài đặt - Video tiếng ViệtKhanhPham
 
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
 
tao module joomla 1.5
tao module  joomla 1.5tao module  joomla 1.5
tao module joomla 1.5dvms
 
Zend Framework 2 - Thao tác Database trong Zend Framework 2 - Bài 8
Zend Framework 2 - Thao tác Database trong Zend Framework 2 - Bài 8 Zend Framework 2 - Thao tác Database trong Zend Framework 2 - Bài 8
Zend Framework 2 - Thao tác Database trong Zend Framework 2 - Bài 8 KhanhPham
 
Tài liệu lập trình Wordpress - bài 5 - Action và Action hook trong Wordpress
Tài liệu lập trình Wordpress - bài 5 - Action và Action hook trong WordpressTài liệu lập trình Wordpress - bài 5 - Action và Action hook trong Wordpress
Tài liệu lập trình Wordpress - bài 5 - Action và Action hook trong WordpressKhanhPham
 
Tài liệu Zend Framework 2 : Thêm dữ liệu vào database trong ZF2 - Bài 10
Tài liệu Zend Framework 2 : Thêm dữ liệu vào database trong ZF2 - Bài 10Tài liệu Zend Framework 2 : Thêm dữ liệu vào database trong ZF2 - Bài 10
Tài liệu Zend Framework 2 : Thêm dữ liệu vào database trong ZF2 - Bài 10KhanhPham
 
Học lập trình Wordpress - bài 2 - Tìm hiểu cấu trúc và cấu hình nâng cao
Học lập trình Wordpress - bài 2 - Tìm hiểu cấu trúc và cấu hình nâng cao Học lập trình Wordpress - bài 2 - Tìm hiểu cấu trúc và cấu hình nâng cao
Học lập trình Wordpress - bài 2 - Tìm hiểu cấu trúc và cấu hình nâng cao KhanhPham
 
Học Zend Framework - Khóa học lập trình Zend Framework
Học Zend Framework - Khóa học lập trình Zend FrameworkHọc Zend Framework - Khóa học lập trình Zend Framework
Học Zend Framework - Khóa học lập trình Zend FrameworkKhanhPham
 
Giáo trình Zend Framework 2.0 - Nhúng template vào ứng dung ZF2 (P3) - Bài 7
Giáo trình Zend Framework 2.0 - Nhúng template vào ứng dung ZF2 (P3) - Bài 7Giáo trình Zend Framework 2.0 - Nhúng template vào ứng dung ZF2 (P3) - Bài 7
Giáo trình Zend Framework 2.0 - Nhúng template vào ứng dung ZF2 (P3) - Bài 7KhanhPham
 

Tendances (20)

The First 2015 Saigon WordPress Meetup
The First 2015 Saigon WordPress MeetupThe First 2015 Saigon WordPress Meetup
The First 2015 Saigon WordPress Meetup
 
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
 
Bài 3 Lập trình PHP (phần 1) - Giáo trình FPT
Bài 3 Lập trình PHP (phần 1) - Giáo trình FPTBài 3 Lập trình PHP (phần 1) - Giáo trình FPT
Bài 3 Lập trình PHP (phần 1) - Giáo trình FPT
 
Web201 slide 1
Web201   slide 1Web201   slide 1
Web201 slide 1
 
Web3012 slide 8
Web3012   slide 8Web3012   slide 8
Web3012 slide 8
 
Wp hoi-thao-phan-quyen
Wp hoi-thao-phan-quyenWp hoi-thao-phan-quyen
Wp hoi-thao-phan-quyen
 
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
 
Web201 slide 6
Web201   slide 6Web201   slide 6
Web201 slide 6
 
Mysql Workbench hướng dẫn cài đặt - Video tiếng Việt
Mysql Workbench hướng dẫn cài đặt - Video tiếng ViệtMysql Workbench hướng dẫn cài đặt - Video tiếng Việt
Mysql Workbench hướng dẫn cài đặt - Video tiếng Việt
 
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
 
Web201 slide 7
Web201   slide 7Web201   slide 7
Web201 slide 7
 
tao module joomla 1.5
tao module  joomla 1.5tao module  joomla 1.5
tao module joomla 1.5
 
Zend Framework 2 - Thao tác Database trong Zend Framework 2 - Bài 8
Zend Framework 2 - Thao tác Database trong Zend Framework 2 - Bài 8 Zend Framework 2 - Thao tác Database trong Zend Framework 2 - Bài 8
Zend Framework 2 - Thao tác Database trong Zend Framework 2 - Bài 8
 
Tài liệu lập trình Wordpress - bài 5 - Action và Action hook trong Wordpress
Tài liệu lập trình Wordpress - bài 5 - Action và Action hook trong WordpressTài liệu lập trình Wordpress - bài 5 - Action và Action hook trong Wordpress
Tài liệu lập trình Wordpress - bài 5 - Action và Action hook trong Wordpress
 
Web3012 assignment
Web3012   assignmentWeb3012   assignment
Web3012 assignment
 
Tài liệu Zend Framework 2 : Thêm dữ liệu vào database trong ZF2 - Bài 10
Tài liệu Zend Framework 2 : Thêm dữ liệu vào database trong ZF2 - Bài 10Tài liệu Zend Framework 2 : Thêm dữ liệu vào database trong ZF2 - Bài 10
Tài liệu Zend Framework 2 : Thêm dữ liệu vào database trong ZF2 - Bài 10
 
Học lập trình Wordpress - bài 2 - Tìm hiểu cấu trúc và cấu hình nâng cao
Học lập trình Wordpress - bài 2 - Tìm hiểu cấu trúc và cấu hình nâng cao Học lập trình Wordpress - bài 2 - Tìm hiểu cấu trúc và cấu hình nâng cao
Học lập trình Wordpress - bài 2 - Tìm hiểu cấu trúc và cấu hình nâng cao
 
Học Zend Framework - Khóa học lập trình Zend Framework
Học Zend Framework - Khóa học lập trình Zend FrameworkHọc Zend Framework - Khóa học lập trình Zend Framework
Học Zend Framework - Khóa học lập trình Zend Framework
 
Giáo trình Zend Framework 2.0 - Nhúng template vào ứng dung ZF2 (P3) - Bài 7
Giáo trình Zend Framework 2.0 - Nhúng template vào ứng dung ZF2 (P3) - Bài 7Giáo trình Zend Framework 2.0 - Nhúng template vào ứng dung ZF2 (P3) - Bài 7
Giáo trình Zend Framework 2.0 - Nhúng template vào ứng dung ZF2 (P3) - Bài 7
 
Web201 slide 2
Web201   slide 2Web201   slide 2
Web201 slide 2
 

En vedette

Bài 7: Xác thực và quản lý tài khoản - Giáo trình FPT
Bài 7: Xác thực và quản lý tài khoản - Giáo trình FPTBài 7: Xác thực và quản lý tài khoản - Giáo trình FPT
Bài 7: Xác thực và quản lý tài khoản - Giáo trình FPTMasterCode.vn
 
Bài 5: Quản trị một mạng an toàn và Bảo mật các mạng không dây - Giáo trình FPT
Bài 5: Quản trị một mạng an toàn và Bảo mật các mạng không dây - Giáo trình FPTBài 5: Quản trị một mạng an toàn và Bảo mật các mạng không dây - Giáo trình FPT
Bài 5: Quản trị một mạng an toàn và Bảo mật các mạng không dây - Giáo trình FPTMasterCode.vn
 
Chương 6 Bảo mật - Giáo trình FPT
Chương 6 Bảo mật - Giáo trình FPTChương 6 Bảo mật - Giáo trình FPT
Chương 6 Bảo mật - Giáo trình FPTMasterCode.vn
 
Bài 4: Bảo mật máy chủ, ứng dụng, dữ liệu và mạng - Giáo trình FPT
Bài 4: Bảo mật máy chủ, ứng dụng, dữ liệu và mạng - Giáo trình FPTBài 4: Bảo mật máy chủ, ứng dụng, dữ liệu và mạng - Giáo trình FPT
Bài 4: Bảo mật máy chủ, ứng dụng, dữ liệu và mạng - Giáo trình FPTMasterCode.vn
 
Bài 2: Phần mềm độc hại và các dạng tấn công sử dụng kỹ nghệ xã hội - Giáo tr...
Bài 2: Phần mềm độc hại và các dạng tấn công sử dụng kỹ nghệ xã hội - Giáo tr...Bài 2: Phần mềm độc hại và các dạng tấn công sử dụng kỹ nghệ xã hội - Giáo tr...
Bài 2: Phần mềm độc hại và các dạng tấn công sử dụng kỹ nghệ xã hội - Giáo tr...MasterCode.vn
 
Bài 3: Tấn công vào ứng dụng và mạng, đánh giá khả năng thiệt hại và làm giảm...
Bài 3: Tấn công vào ứng dụng và mạng, đánh giá khả năng thiệt hại và làm giảm...Bài 3: Tấn công vào ứng dụng và mạng, đánh giá khả năng thiệt hại và làm giảm...
Bài 3: Tấn công vào ứng dụng và mạng, đánh giá khả năng thiệt hại và làm giảm...MasterCode.vn
 
Chương 5 Chia sẻ file và máy in trên mạng - Giáo trình FPT
Chương 5 Chia sẻ file và máy in trên mạng - Giáo trình FPTChương 5 Chia sẻ file và máy in trên mạng - Giáo trình FPT
Chương 5 Chia sẻ file và máy in trên mạng - Giáo trình FPTMasterCode.vn
 
Bài 8: Triển khai bảo mật sử dụng chính sách nhóm (Group policy) - Giáo trình...
Bài 8: Triển khai bảo mật sử dụng chính sách nhóm (Group policy) - Giáo trình...Bài 8: Triển khai bảo mật sử dụng chính sách nhóm (Group policy) - Giáo trình...
Bài 8: Triển khai bảo mật sử dụng chính sách nhóm (Group policy) - Giáo trình...MasterCode.vn
 
Bài 1: GIỚI THIỆU VỀ BẢO MẬT - Giáo trình FPT
Bài 1: GIỚI THIỆU VỀ BẢO MẬT - Giáo trình FPTBài 1: GIỚI THIỆU VỀ BẢO MẬT - Giáo trình FPT
Bài 1: GIỚI THIỆU VỀ BẢO MẬT - Giáo trình FPTMasterCode.vn
 

En vedette (9)

Bài 7: Xác thực và quản lý tài khoản - Giáo trình FPT
Bài 7: Xác thực và quản lý tài khoản - Giáo trình FPTBài 7: Xác thực và quản lý tài khoản - Giáo trình FPT
Bài 7: Xác thực và quản lý tài khoản - Giáo trình FPT
 
Bài 5: Quản trị một mạng an toàn và Bảo mật các mạng không dây - Giáo trình FPT
Bài 5: Quản trị một mạng an toàn và Bảo mật các mạng không dây - Giáo trình FPTBài 5: Quản trị một mạng an toàn và Bảo mật các mạng không dây - Giáo trình FPT
Bài 5: Quản trị một mạng an toàn và Bảo mật các mạng không dây - Giáo trình FPT
 
Chương 6 Bảo mật - Giáo trình FPT
Chương 6 Bảo mật - Giáo trình FPTChương 6 Bảo mật - Giáo trình FPT
Chương 6 Bảo mật - Giáo trình FPT
 
Bài 4: Bảo mật máy chủ, ứng dụng, dữ liệu và mạng - Giáo trình FPT
Bài 4: Bảo mật máy chủ, ứng dụng, dữ liệu và mạng - Giáo trình FPTBài 4: Bảo mật máy chủ, ứng dụng, dữ liệu và mạng - Giáo trình FPT
Bài 4: Bảo mật máy chủ, ứng dụng, dữ liệu và mạng - Giáo trình FPT
 
Bài 2: Phần mềm độc hại và các dạng tấn công sử dụng kỹ nghệ xã hội - Giáo tr...
Bài 2: Phần mềm độc hại và các dạng tấn công sử dụng kỹ nghệ xã hội - Giáo tr...Bài 2: Phần mềm độc hại và các dạng tấn công sử dụng kỹ nghệ xã hội - Giáo tr...
Bài 2: Phần mềm độc hại và các dạng tấn công sử dụng kỹ nghệ xã hội - Giáo tr...
 
Bài 3: Tấn công vào ứng dụng và mạng, đánh giá khả năng thiệt hại và làm giảm...
Bài 3: Tấn công vào ứng dụng và mạng, đánh giá khả năng thiệt hại và làm giảm...Bài 3: Tấn công vào ứng dụng và mạng, đánh giá khả năng thiệt hại và làm giảm...
Bài 3: Tấn công vào ứng dụng và mạng, đánh giá khả năng thiệt hại và làm giảm...
 
Chương 5 Chia sẻ file và máy in trên mạng - Giáo trình FPT
Chương 5 Chia sẻ file và máy in trên mạng - Giáo trình FPTChương 5 Chia sẻ file và máy in trên mạng - Giáo trình FPT
Chương 5 Chia sẻ file và máy in trên mạng - Giáo trình FPT
 
Bài 8: Triển khai bảo mật sử dụng chính sách nhóm (Group policy) - Giáo trình...
Bài 8: Triển khai bảo mật sử dụng chính sách nhóm (Group policy) - Giáo trình...Bài 8: Triển khai bảo mật sử dụng chính sách nhóm (Group policy) - Giáo trình...
Bài 8: Triển khai bảo mật sử dụng chính sách nhóm (Group policy) - Giáo trình...
 
Bài 1: GIỚI THIỆU VỀ BẢO MẬT - Giáo trình FPT
Bài 1: GIỚI THIỆU VỀ BẢO MẬT - Giáo trình FPTBài 1: GIỚI THIỆU VỀ BẢO MẬT - Giáo trình FPT
Bài 1: GIỚI THIỆU VỀ BẢO MẬT - Giáo trình FPT
 

Similaire à Web203 slide 5

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 9KhanhPham
 
E learning lab - Tim hieu Cake PHP
E learning lab - Tim hieu Cake PHPE learning lab - Tim hieu Cake PHP
E learning lab - Tim hieu Cake PHPelearninglabvn
 
DVMS tạo module joomla 2.5
DVMS tạo module joomla 2.5DVMS tạo module joomla 2.5
DVMS tạo module joomla 2.5dvms
 
TÀI LIỆU HƯỚNG VIẾT MODULE VÀ WEBSERVICE CHO MAGENTO 1.7
TÀI LIỆU HƯỚNG VIẾT MODULE VÀ WEBSERVICE CHO MAGENTO 1.7TÀI LIỆU HƯỚNG VIẾT MODULE VÀ WEBSERVICE CHO MAGENTO 1.7
TÀI LIỆU HƯỚNG VIẾT MODULE VÀ WEBSERVICE CHO MAGENTO 1.7dvms
 
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-hdsdVu Hung Nguyen
 
Co ban ve_zend_framework 1
Co ban ve_zend_framework 1Co ban ve_zend_framework 1
Co ban ve_zend_framework 1Ông Thông
 
Devwork.vn Tài liệu lập trình PHP Laravel
Devwork.vn Tài liệu lập trình PHP LaravelDevwork.vn Tài liệu lập trình PHP Laravel
Devwork.vn Tài liệu lập trình PHP LaravelDevwork
 
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-mvcChe Linh Nguyen
 
Tailieuonline.tk joomla-viet-component
 Tailieuonline.tk joomla-viet-component Tailieuonline.tk joomla-viet-component
Tailieuonline.tk joomla-viet-componentzzbabyloveszz
 
Bài 6: Tạo hiệu ứng và validate Form - Giáo trình FPT
Bài 6: Tạo hiệu ứng và validate Form - Giáo trình FPTBài 6: Tạo hiệu ứng và validate Form - Giáo trình FPT
Bài 6: Tạo hiệu ứng và validate Form - Giáo trình FPTMasterCode.vn
 
Lớp kết nối csdl dùng jdbc trong java
Lớp kết nối csdl dùng jdbc trong javaLớp kết nối csdl dùng jdbc trong java
Lớp kết nối csdl dùng jdbc trong javaANHMATTROI
 
Create easymoduleinphpfox
Create easymoduleinphpfoxCreate easymoduleinphpfox
Create easymoduleinphpfoxEntu Di
 
Tutoria mvc framework
Tutoria mvc frameworkTutoria mvc framework
Tutoria mvc frameworkXuan Le
 

Similaire à Web203 slide 5 (20)

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
 
E learning lab - Tim hieu Cake PHP
E learning lab - Tim hieu Cake PHPE learning lab - Tim hieu Cake PHP
E learning lab - Tim hieu Cake PHP
 
Giới thiệu Yii Framework 1
Giới thiệu Yii Framework 1Giới thiệu Yii Framework 1
Giới thiệu Yii Framework 1
 
Yii
YiiYii
Yii
 
DVMS tạo module joomla 2.5
DVMS tạo module joomla 2.5DVMS tạo module joomla 2.5
DVMS tạo module joomla 2.5
 
TÀI LIỆU HƯỚNG VIẾT MODULE VÀ WEBSERVICE CHO MAGENTO 1.7
TÀI LIỆU HƯỚNG VIẾT MODULE VÀ WEBSERVICE CHO MAGENTO 1.7TÀI LIỆU HƯỚNG VIẾT MODULE VÀ WEBSERVICE CHO MAGENTO 1.7
TÀI LIỆU HƯỚNG VIẾT MODULE VÀ WEBSERVICE CHO MAGENTO 1.7
 
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
 
Co ban ve_zend_framework 1
Co ban ve_zend_framework 1Co ban ve_zend_framework 1
Co ban ve_zend_framework 1
 
Devwork.vn Tài liệu lập trình PHP Laravel
Devwork.vn Tài liệu lập trình PHP LaravelDevwork.vn Tài liệu lập trình PHP Laravel
Devwork.vn Tài liệu lập trình PHP Laravel
 
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
 
Tailieuonline.tk joomla-viet-component
 Tailieuonline.tk joomla-viet-component Tailieuonline.tk joomla-viet-component
Tailieuonline.tk joomla-viet-component
 
Joo
JooJoo
Joo
 
Bài 6: Tạo hiệu ứng và validate Form - Giáo trình FPT
Bài 6: Tạo hiệu ứng và validate Form - Giáo trình FPTBài 6: Tạo hiệu ứng và validate Form - Giáo trình FPT
Bài 6: Tạo hiệu ứng và validate Form - Giáo trình FPT
 
Lớp kết nối csdl dùng jdbc trong java
Lớp kết nối csdl dùng jdbc trong javaLớp kết nối csdl dùng jdbc trong java
Lớp kết nối csdl dùng jdbc trong java
 
Aspnet 3.5 _04
Aspnet 3.5 _04Aspnet 3.5 _04
Aspnet 3.5 _04
 
C5. Model, DataSharing.pdf
C5. Model, DataSharing.pdfC5. Model, DataSharing.pdf
C5. Model, DataSharing.pdf
 
Create easymoduleinphpfox
Create easymoduleinphpfoxCreate easymoduleinphpfox
Create easymoduleinphpfox
 
Mvc Model
Mvc ModelMvc Model
Mvc Model
 
Bai08 10 java_fx
Bai08 10 java_fxBai08 10 java_fx
Bai08 10 java_fx
 
Tutoria mvc framework
Tutoria mvc frameworkTutoria mvc framework
Tutoria mvc framework
 

Plus de tuanduongcntt (20)

Slide5 html5
Slide5 html5Slide5 html5
Slide5 html5
 
Slide4 html5
Slide4 html5Slide4 html5
Slide4 html5
 
Slide3 html5
Slide3 html5Slide3 html5
Slide3 html5
 
Slide2 html5
Slide2 html5Slide2 html5
Slide2 html5
 
Slide1 html5
Slide1 html5Slide1 html5
Slide1 html5
 
Slide6 html5
Slide6 html5Slide6 html5
Slide6 html5
 
Web301 slide 7
Web301   slide 7Web301   slide 7
Web301 slide 7
 
Web301 slide 6
Web301   slide 6Web301   slide 6
Web301 slide 6
 
Web301 slide 5
Web301   slide 5Web301   slide 5
Web301 slide 5
 
Web301 slide 3
Web301   slide 3Web301   slide 3
Web301 slide 3
 
Web2032 assignment
Web2032   assignmentWeb2032   assignment
Web2032 assignment
 
Web203 slide 9
Web203   slide 9Web203   slide 9
Web203 slide 9
 
Web203 slide 8
Web203   slide 8Web203   slide 8
Web203 slide 8
 
Web203 slide 7
Web203   slide 7Web203   slide 7
Web203 slide 7
 
Web203 slide 4
Web203   slide 4Web203   slide 4
Web203 slide 4
 
Web203 slide 3
Web203   slide 3Web203   slide 3
Web203 slide 3
 
Web203 slide 2
Web203   slide 2Web203   slide 2
Web203 slide 2
 
Web203 slide 1
Web203   slide 1Web203   slide 1
Web203 slide 1
 
Web2032 slide 10
Web2032   slide 10Web2032   slide 10
Web2032 slide 10
 
Web2022 slide 7
Web2022   slide 7Web2022   slide 7
Web2022 slide 7
 

Web203 slide 5

  • 1. Bài 5 Hướng dẫn xây dựng Extension
  • 2. Nhắc lại bài cũ • Chỉnh sửa template thông qua chỉnh sửa hình ảnh, chỉnh sửa CSS • Cấu trúc file và thư mục của một Template Bài 5 - Hướng dẫn xây dựng Extension
  • 3. Mục tiêu bài học • Hiểu rõ cấu trúc của component; module • Hiểu rõ về quy trình, cách thức, giải pháp xây dựng component, module Bài 5 - Hướng dẫn xây dựng Extension
  • 4. Xây dựng Component Xây dựng component theo mô hình MVC - Các component Joomla được xây dựng theo mô hình MVC (Model-View-Controler); User (Khách truy cập web) Bài 5 - Hướng dẫn xây dựng Extension View (tạo giao diện hiển thị) Model (thiết lập các chức năng web) Controler (điều khiển, xử lý tương tác)
  • 5. Xây dựng Component Xây dựng 1 Component đơn giản: Component Hello Bài 5 - Hướng dẫn xây dựng Extension
  • 6. Xây dựng Component Component cơ bản có 5 file: • site/hello.php - file tạo entry point • site/controller.php - Thiết lập điều khiển • site/views/hello/view.html.php - Thiết lập hiển thị • site/views/hello/tmpl/default.php - Tạo giao diện hiển thị • hello.xml - Đóng gói thành bộ cài Bài 5 - Hướng dẫn xây dựng Extension • site/hello.php - file tạo entry point • site/controller.php - Thiết lập điều khiển • site/views/hello/view.html.php - Thiết lập hiển thị • site/views/hello/tmpl/default.php - Tạo giao diện hiển thị • hello.xml - Đóng gói thành bộ cài
  • 7. Xây dựng Component Lập trình file Hello.php - Tạo entry point <?php defined( '_JEXEC' ) or die( 'Restricted access' ); require_once( JPATH_COMPONENT.DS.'controller.php' ); if ($controller = JRequest::getWord('controller')) { $path = JPATH_COMPONENT.DS.'controllers'.DS.$controller.'.php'; if (file_exists($path)) { require_once $path; } else { $controller = ''; } } $classname = 'HelloController'.$controller; $controller = new $classname(); $controller->execute( JRequest::getVar( 'task' ) ); $controller->redirect(); Bài 5 - Hướng dẫn xây dựng Extension <?php defined( '_JEXEC' ) or die( 'Restricted access' ); require_once( JPATH_COMPONENT.DS.'controller.php' ); if ($controller = JRequest::getWord('controller')) { $path = JPATH_COMPONENT.DS.'controllers'.DS.$controller.'.php'; if (file_exists($path)) { require_once $path; } else { $controller = ''; } } $classname = 'HelloController'.$controller; $controller = new $classname(); $controller->execute( JRequest::getVar( 'task' ) ); $controller->redirect();
  • 8. Xây dựng Component Tạo controller với file controller.php <?php defined( '_JEXEC' ) or die( 'Restricted access' ); jimport('joomla.application.component.controller'); class HelloController extends JController { function display() { parent::display(); } } Bài 5 - Hướng dẫn xây dựng Extension <?php defined( '_JEXEC' ) or die( 'Restricted access' ); jimport('joomla.application.component.controller'); class HelloController extends JController { function display() { parent::display(); } }
  • 9. Xây dựng Component Tạo view - lập trình file site/views/hello/view.html.php <?php defined( '_JEXEC' ) or die( 'Restricted access' ); jimport( 'joomla.application.component.view'); class HelloViewHello extends JView { function display($tpl = null) { $greeting = "Hello, World!"; $this->assignRef( 'greeting', $greeting ); parent::display($tpl); } } Bài 5 - Hướng dẫn xây dựng Extension <?php defined( '_JEXEC' ) or die( 'Restricted access' ); jimport( 'joomla.application.component.view'); class HelloViewHello extends JView { function display($tpl = null) { $greeting = "Hello, World!"; $this->assignRef( 'greeting', $greeting ); parent::display($tpl); } }
  • 10. Xây dựng Component Tạo Template tại file site/views/hello/tmpl/default.php <?php defined('_JEXEC') or die('Restricted access'); ?> <h1><?php echo $this->greeting; ?></h1> Bài 5 - Hướng dẫn xây dựng Extension
  • 11. Xây dựng Component Viết file XML (install.xml) <?xml version="1.0" encoding="utf-8"?> <install type="component" version="1.5.0"> <name>Hello</name> <creationDate>2007-02-22</creationDate> <author>John Doe</author> <authorEmail>john.doe@example.org</authorEmail> <authorUrl>http://www.example.org</authorUrl> <copyright>Copyright Info</copyright> <license>License Info</license> <version>1.01</version> <description>Description of the component ...</description> <files folder="site"> <filename>controller.php</filename> <filename>hello.php</filename> <filename>index.html</filename> <filename>views/index.html</filename> <filename>views/hello/index.html</filename> <filename>views/hello/view.html.php</filename> <filename>views/hello/tmpl/default.php</filename> <filename>views/hello/tmpl/index.html</filename> </files> Bài 5 - Hướng dẫn xây dựng Extension <?xml version="1.0" encoding="utf-8"?> <install type="component" version="1.5.0"> <name>Hello</name> <creationDate>2007-02-22</creationDate> <author>John Doe</author> <authorEmail>john.doe@example.org</authorEmail> <authorUrl>http://www.example.org</authorUrl> <copyright>Copyright Info</copyright> <license>License Info</license> <version>1.01</version> <description>Description of the component ...</description> <files folder="site"> <filename>controller.php</filename> <filename>hello.php</filename> <filename>index.html</filename> <filename>views/index.html</filename> <filename>views/hello/index.html</filename> <filename>views/hello/view.html.php</filename> <filename>views/hello/tmpl/default.php</filename> <filename>views/hello/tmpl/index.html</filename> </files>
  • 12. Xây dựng Component <administration> <menu>Hello World!</menu> <files folder="admin"> <filename>hello.php</filename> <filename>index.html</filename> </files> </administration> </install> Bài 5 - Hướng dẫn xây dựng Extension <administration> <menu>Hello World!</menu> <files folder="admin"> <filename>hello.php</filename> <filename>index.html</filename> </files> </administration> </install>
  • 13. Xây dựng Component Tạo file index.html để bảo mật <html><body bgcolor="#FFFFFF"></body></html> Bài 5 - Hướng dẫn xây dựng Extension
  • 14. Xây dựng Component Bổ xung Model tại site/models/hello.php <?php defined( '_JEXEC' ) or die( 'Restricted access' ); jimport( 'joomla.application.component.model' ); class HelloModelHello extends JModel { function getGreeting() { return 'Hello, World!'; } }Bài 5 - Hướng dẫn xây dựng Extension <?php defined( '_JEXEC' ) or die( 'Restricted access' ); jimport( 'joomla.application.component.model' ); class HelloModelHello extends JModel { function getGreeting() { return 'Hello, World!'; } }
  • 15. Xây dựng Component Sử dụng Model: bằng cách thay đổi tại dòng $greeting = "Hello World!"; tại file site/views/hello/view.html.php <?php defined( '_JEXEC' ) or die( 'Restricted access' ); jimport( 'joomla.application.component.view'); class HelloViewHello extends JView { function display($tpl = null) { $model =& $this->getModel(); $greeting = $model->getGreeting(); $this->assignRef( 'greeting', $greeting ); parent::display($tpl); } }Bài 5 - Hướng dẫn xây dựng Extension <?php defined( '_JEXEC' ) or die( 'Restricted access' ); jimport( 'joomla.application.component.view'); class HelloViewHello extends JView { function display($tpl = null) { $model =& $this->getModel(); $greeting = $model->getGreeting(); $this->assignRef( 'greeting', $greeting ); parent::display($tpl); } }
  • 16. Xây dựng Component Bổ sung file vào gói cài đặt bằng dòng lệnh <filename>models/hello.php</filename> <files folder="site"> <filename>controller.php</filename> <filename>hello.php</filename> <filename>index.html</filename> <filename>models/hello.php</filename> <filename>models/index.html</filename> <filename>views/index.html</filename> <filename>views/hello/index.html</filename> <filename>views/hello/view.html.php</filename> <filename>views/hello/tmpl/default.php</filename> <filename>views/hello/tmpl/index.html</filename> </files> Bài 5 - Hướng dẫn xây dựng Extension <files folder="site"> <filename>controller.php</filename> <filename>hello.php</filename> <filename>index.html</filename> <filename>models/hello.php</filename> <filename>models/index.html</filename> <filename>views/index.html</filename> <filename>views/hello/index.html</filename> <filename>views/hello/view.html.php</filename> <filename>views/hello/tmpl/default.php</filename> <filename>views/hello/tmpl/index.html</filename> </files>
  • 17. Xây dựng Module Cấu trúc các file trong 1 module: • mod_helloworld.php • mod_helloworld.xml • helper.php • tmpl/default.php Bài 5 - Hướng dẫn xây dựng Extension • mod_helloworld.php • mod_helloworld.xml • helper.php • tmpl/default.php
  • 18. Xây dựng Module File mod_helloworld.php <?php defined( '_JEXEC' ) or die( 'Restricted access' ); require_once( dirname(__FILE__).DS.'helper.php' ); $hello = modHelloWorldHelper::getHello( $params ); require( JModuleHelper::getLayoutPath( 'mod_helloworld' ) ); ?> Bài 5 - Hướng dẫn xây dựng Extension <?php defined( '_JEXEC' ) or die( 'Restricted access' ); require_once( dirname(__FILE__).DS.'helper.php' ); $hello = modHelloWorldHelper::getHello( $params ); require( JModuleHelper::getLayoutPath( 'mod_helloworld' ) ); ?>
  • 19. Xây dựng Module File helper.php <?php class modHelloWorldHelper { function getHello( $params ) { return 'Hello, World!'; } } ?> Bài 5 - Hướng dẫn xây dựng Extension <?php class modHelloWorldHelper { function getHello( $params ) { return 'Hello, World!'; } } ?>
  • 20. Xây dựng Module File tmpl/defalt.php <?php // no direct access defined( '_JEXEC' ) or die( 'Restricted access' ); ?> <?php echo $hello; ?> Bài 5 - Hướng dẫn xây dựng Extension
  • 21. Xây dựng Module File mod_hello_world.xml <?xml version="1.0" encoding="utf-8"?> <install type="module" version="1.5.0"> <name>Hello, World!</name> <author>John Doe</author> <version>1.5.0</version> <description>A simple Hello, World! module.</description> <files> <filename>mod_helloworld.xml</filename> <filename module="mod_helloworld">mod_helloworld.php</filename> <filename>index.html</filename> <filename>helper.php</filename> <filename>tmpl/default.php</filename> <filename>tmpl/index.html</filename> </files> <params> </params> </install> Bài 5 - Hướng dẫn xây dựng Extension <?xml version="1.0" encoding="utf-8"?> <install type="module" version="1.5.0"> <name>Hello, World!</name> <author>John Doe</author> <version>1.5.0</version> <description>A simple Hello, World! module.</description> <files> <filename>mod_helloworld.xml</filename> <filename module="mod_helloworld">mod_helloworld.php</filename> <filename>index.html</filename> <filename>helper.php</filename> <filename>tmpl/default.php</filename> <filename>tmpl/index.html</filename> </files> <params> </params> </install>
  • 22. Xây dựng Module Tạo file index.html trong các thư mục của module để bảo mật với nội dung: <html><body bgcolor="#FFFFFF"></body></html> Bài 5 - Hướng dẫn xây dựng Extension
  • 23. Tổng kết bài học • Các component trong Joomla được xây dựng theo mô hình MVC và dựa vào Joomla Framework - thư viện mã nguồn sẵn có trong Joomla CMS. • Quy trình xây dựng giống nhau đối với tất cả các component hay module. • Sau khi hoàn thiện lập trình một component hay module, cần đóng gói thành file .zip để có thể cài đặt vào Joomla từ trình cài đặt tháo gỡ tự động của Joomla • Các component trong Joomla được xây dựng theo mô hình MVC và dựa vào Joomla Framework - thư viện mã nguồn sẵn có trong Joomla CMS. • Quy trình xây dựng giống nhau đối với tất cả các component hay module. • Sau khi hoàn thiện lập trình một component hay module, cần đóng gói thành file .zip để có thể cài đặt vào Joomla từ trình cài đặt tháo gỡ tự động của Joomla Bài 5 - Hướng dẫn xây dựng Extension