dongyiyu3953 2016-08-10 01:09
浏览 48

Joomla 3 $ params-> get在模块中返回NULL值

I am writing a new module for Joomla! 3 and I am stumped by $params->get.

I can see the values in the database within the modules table, but the following code returns nothing for every parameter that have been set, including the default parameters of module_tag, bootstrap_size, header_tag, header_class, style.

The code is:

$app = JFactory::getApplication();
$params = $app->getParams();
$param = $params->get('module_tag');

When looking at the type of the variable $param, the type is retuned as NULL.

Joomla! 3.6.2
Stable PHP 5.6.18
MySQL 5.6.31

  • 写回答

2条回答 默认 最新

  • douba9654 2016-08-10 01:29
    关注

    You have to specify the module name of which you would like to retrieve the parameters. Replace 'moduleName' with the name of your module.

    $app = JFactory::getApplication();
    $params = $app->getParams('moduleName');
    $param = $params->get('module_tag');
    
    评论

报告相同问题?

悬赏问题

  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改