phpeveryday.com

The best tutorial of php, php framework, php strategies, object oriented oriented,


Joomla - MVC: Reorganizing Back End Code

Tag: joomla, MVC, pattern, component   Category: PHP Framework
post: 06 Feb 2008 read: 2,240


Joomla Back End MVC Step By Step Tutorial - Part 1: Return we talk again aboutJoomla with the MVC viewpoint. We have learned the Joomla MVC at this post as starting point. That Tutorial focus the side front-end. In this post, we will study how to apply it at the back end side. We will reorganize the code use MVC.

We still work with our hello component. First, we will modify code which joomla execute for first time. I bet you know. Yes, admin.hello.php (if you still don't know, you can read from first at here). Ok, open your admin.hello.php within Joomla\administrator\components\com_hello. Replace with following code:

joomla mvc back end side

<?php
defined( '_JEXEC' ) or die( 'Restricted access' );

require_once(JApplicationHelper::getPath('admin_html'));
require_once(JPATH_COMPONENT.DS.'controller.php');
JTable::addIncludePath(JPATH_COMPONENT.DS.'tables');

$controller = new HelloController(
                  array('default_task'=>'showHellos'));
$controller->execute( JRequest::getVar('task') );
$controller->redirect();

?>

Next, we will talk about controller at back end.



Series this article:
Joomla - MVC: Reorganizing Back End Code
Joomla - MVC: Creating Controller and Model for Back End
Joomla - MVC: Creating View for Back End
Joomla - MVC: Adding Pagination for Back End
Joomla - MVC: Adding Element Paginating for Back End
Joomla - MVC: Creating Form Input Data for Back-End
Joomla - MVC: Saving Data for Back End
Joomla - MVC: Editing Data for Back-End
Joomla - MVC: Adding Delete Function at Back-End
Joomla - MVC: Controlling Publish State for Back-End

| Give Your Opinion | Recommend
Share and Bookmark to: These icons link to social bookmarking sites where readers can share and discover new web pages.
digg del.icio.us technorati Ma.gnolia BlinkList

Recommended articles by other readers:
Web Services: How PHP Kiss VB.NET? (Part 1)
Chart: How to Build Cool Animation Real Time Chart
Joomla: Fast Road to Understand Component Programming
Email: Send Attachement Mail
mod_rewrite - Part 1: create your "fantasy" URL

What do You Think?
Your Name *:
Email *:
(Will not be published)
Website/URL:
Your Comment *:
* Required


619
posting