phproberto / joomla-module

用于交互和开发 Joomla! 模块的库

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

This package is auto-updated.

Last update: 2024-09-10 13:55:10 UTC


README

用于开发 Joomla! 模块的基类。

Build Status Code Coverage Scrutinizer Code Quality

尚未准备好用于生产

什么?

你是否见过这样的东西?

// 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'));

难道不能直接使用这样的东西更好吗?

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

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

Joomla! 不使用 OOP 的唯一部分就是模块。现在开始使用这些模块类,并利用其优势。

要求

  • PHP 5.4+ 由于使用了 traits
  • Joomla! CMS v3.7+

优势

  • 模块只从数据库加载一次。
  • 支持旧模板系统(99% 兼容)和 JLayoutFile 布局。
  • 轻松且透明地加载和保存模块参数。
  • 单元测试确保您的模块永远不会出错。
  • 基于多年的 Joomla! 模块处理经验构建。
  • 100% 开源。

文档

请参阅 文档 获取详细文档。

许可

此库受 GNU/GPL 2 许可 许可。

版权 (C) 2017 Roberto Segura López - 版权所有。