P. 1
Developing Joomla 1.5 Modules by Peter Martin

Developing Joomla 1.5 Modules by Peter Martin

5.0

|Views: 1,864|Likes:
Published by Peter Martin
English sheets from presentation by Peter Martin at the Joomladays 2009 in Nieuwegein, The Netherlands.

Presentation was about module development for Joomla 1.5. It has two examples of a small module:
a simple module (with two files) and the same module in MVC (Module-View-Controller).
Both sample modules can be downloaded at http://www.db8.nl/en/downloads/misc-downloads.html

Done on Saturday 13th of June 2009.
(Dutch name: Module ontwikkeling).
English sheets from presentation by Peter Martin at the Joomladays 2009 in Nieuwegein, The Netherlands.

Presentation was about module development for Joomla 1.5. It has two examples of a small module:
a simple module (with two files) and the same module in MVC (Module-View-Controller).
Both sample modules can be downloaded at http://www.db8.nl/en/downloads/misc-downloads.html

Done on Saturday 13th of June 2009.
(Dutch name: Module ontwikkeling).

More info:

Published by: Peter Martin on Jun 15, 2009
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as ODP, PDF or read online from Scribd
See more
See less

05/11/2014

pdf

original

defined('_JEXEC') or die('Restricted access');

//Trigger Helper file

require_once (dirname(__FILE__).DS.'helper.php');

$list = modDB8LatestWeblinksHelper::getItems($params);

//Trigger Layout file mod_db8latestweblinks/tmpl/default.php

require(JModuleHelper::getLayoutPath('mod_db8latestweblinks'));

mod_db8latestweblinks.php

Peter Martin – joomladays.nl – 13 June 2009

36

helper.php - shown in 3 parts: overview

class modDB8LatestWeblinksHelper

{

// [retrieve parameters]

// [retrieve database records]

// [return data]

}

Module - MVC style: 2. helper file

Peter Martin – joomladays.nl – 13 June 2009

37

Module - MVC style: 2. helper file

helper.php - shown in 3 parts: 1st

part

class modDB8LatestWeblinksHelper

{

function &getItems(&$params){

// [retrieve parameters]

$count = intval($params->get('count', 5));

// [retrieve database records]

// [return data]

}

}

Peter Martin – joomladays.nl – 13 June 2009

38

Module - MVC style: 2. helper file

helper.php - shown in 3 parts: 2nd

part

class modDB8LatestWeblinksHelper

{

function &getItems(&$params){

// [retrieve parameters]

// [retrieve database records]

$db =& JFactory::getDBO();

$query = 'SELECT title, url, description' .

' FROM #__weblinks' .

' ORDER BY date DESC';

$db->setQuery($query,0,$count);

$list = $db->loadObjectList();

// [return data]

}

}

Peter Martin – joomladays.nl – 13 June 2009

39

Module - MVC style: 2. helper file

helper.php - shown in 3 parts: 3rd

part

class modDB8LatestWeblinksHelper

{

function &getItems(&$params){

// [retrieve parameters]

// [retrieve database records]

// [return data]

return $list;

}

}

Peter Martin – joomladays.nl – 13 June 2009

40

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->