phproberto/joomla-module

Library to interact and develop Joomla! modules

dev-master 2017-06-22 14:33 UTC

This package is auto-updated.

Last update: 2024-04-10 13:00:33 UTC


README

Base classes to develop Joomla! Modules.

Build Status Code Coverage Scrutinizer Code Quality

STILL NOT READY FOR PRODUCTION

What?

Have you ever seen something like this?

// Include the latest functions only once
JLoader::register('ModArticlesLatestHelper', __DIR__ . '/helper.php');

$list            = ModArticlesLatestHelper::getList($params);
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8');

require JModuleHelper::getLayoutPath('mod_articles_latest', $params->get('layout', 'default'));

Wouldn't be better to be able to just use something like this?

JLoader::registerPrefix('ModArticlesLatest', __DIR__);

echo ModArticlesLatestModule::getInstance($module->id)->setParams($params)->render();

Modules are the only part where Joomla! doesn't use OOP. Start using these module classes now and take advantage of its benefits.

Requirements

  • PHP 5.4+ Due to the use of traits
  • Joomla! CMS v3.7+

Benefits

  • Modules are only loaded once from database.
  • Support for legacy templates system (99% backward compatible) and JLayoutFile layouts.
  • Easily and transparently load & save module parameters.
  • Unit tested to ensure that your modules are never broken.
  • Built over years of experience dealing with Joomla! modules.
  • 100% Opensource.

Documentation

Check docs for detailed documentation.

License

This library is licensed under GNU/GPL 2 license.

Copyright (C) 2017 Roberto Segura López - All rights reserved.