Answer the question
In order to leave comments, you need to log in
How to get joomla module parameters?
I am writing a module and ran into a problem, I can’t get the parameter data in mod_mymodulename.php, the data is available in the mod_mymodulename/tmpl/default.php template file. Where to dig?
Answer the question
In order to leave comments, you need to log in
Look at the $module
variable
It should be available in mod_mymodulename.php (controller)
It has a $module->params parameter that stores all module parameters in JSON format.
$param=json_decode($module->params)
jimport( 'joomla.application.module.helper' ); // подключаем нужный класс, один раз на странице, перед первым выводом
$module = JModuleHelper::getModule('mod_module'); // получаем объект модуля, mod_module - имя модуля в папке modules
$param = json_decode($module->params); // декодирует JSON с параметрами модуля
echo '<pre>';
print_r($param); // смотрим все параметры
echo '</pre>';
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question