====== Prepare Joomla 5 ======
===== BethicoLeague 5 deprecated =====
^ BethicoLeague 3.10 ^ BethicoLeague 5.0 ^
| ''IPL_CUR_SEASON_ID'' | ''$model['season']->activeSeasonId()'' |
| ''BETHICO_TEMPLATE_URI'' | ''URI::base(true).'/templates/'.Factory::getApplication()->getTemplate(true)->template'' |
| ''BETHICO_STANDINGS_VIEW'' | ''$model['season']->teamLeague()'' |
| ''$bethicoMainConfig'' | ''$model['season']->getMainConfig($seasonId)'' |
| ''$bethicoConfig'' | ''$model['season']->getConfig($seasonId)'' |
| ''$bethicoTeamLeague'' | ''$model['season']->teamLeague()''\\ ''$model['league']->teamLeague()'' |
| ''$bethicoLeague'' | ''$model['season']->getMainConfig($seasonId)->league'' |
| '''' | '''' |
| '''' | '''' |
| '''' | '''' |
| '''' | '''' |
| '''' | '''' |
| db: ''#__bethico_config->league'' | options: ''league_type'' |
| db: ''#__bethico_config->league_code'' | options: ''league_code''\\ (db prefix if empty) |
| db: ''#__bethico_config->time_string'' | options: ''time_locale'' |
| db: ''#__bethico_config->start_year'' | options: ''start_year''\\ ''mod_bethico_legal: year'' |
| db: ''#__bethico_config->frames_term'' | options: ''frames_term'' |
| db: ''#__bethico_config->bye_term'' | options: ''bye_term'' |
| options: ''wiki'' | options: ''wikiURL'' FIXME |
==== Todo Admin ====
* check and set options if empty in Plugin Bethico or BethicoAdmin:use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\Event\Event;
class PlgSystemMyPlugin extends CMSPlugin
{
public function onExtensionBeforeSave($context, $table)
{
// 1. Check if we are saving component options (com_config)
if ($context !== 'com_config.component') {
return;
}
// 2. Identify which component's options were saved
$componentName = $table->element; // e.g., 'com_content'
if ($componentName === 'com_mycomponent') {
// 3. React to the save (e.g., clear cache, log activity)
$params = $table->params; // The new parameters
// Your custom logic here
// check whether we can modify $table, or we need to call $table->params->set('start_year', date('Y'));
}
}
}
==== Todo Site ====
===== Get model =====
public function getOtherModelData()
{
// ... some logic ...
// Get an instance of 'MyModel2' from the same component (e.g., 'com_mycomponent')
// Assumes MyModel2 is in the Site directory if the current model is in Site
$otherModel = Factory::getApplication()
->bootComponent('com_mycomponent')
->getMVCFactory()
->createModel('MyModel2', 'Site'); // Replace 'Site' with 'Administrator', 'Cli', or 'Api' if needed
// Now you can call methods on the other model
$items = $otherModel->getItems(); // Example method call
return $items;
}
===== Joomla 5 deprecated =====
^ Joomla 3.10 ^ Joomla 5.0 ^ Joomla 6.0 ^
| ''Factory::getConfig()'' | ''$app->getConfig()'' | ''$app->getConfig()'' |
===== Joomla 5 changes =====
* WebAssetManager paths
* Language strings: no multiline
===== Links =====
* [[https://manual.joomla.org/docs/building-extensions/modules/module-development-tutorial/|Module Development Tutorial]]
* [[https://docs.joomla.org/how_do_you_put_a_module_inside_an_article%3F|How do you put a module inside an article?]]