【发布时间】:2013-07-21 05:33:38
【问题描述】:
我想为我自己的网站创建一个 joomla 3.1 模块。我需要知道如何获取当前类别 id、父类别 id、当前页面 id。请有人告诉我该怎么做。感谢您的提前
【问题讨论】:
标签: joomla
我想为我自己的网站创建一个 joomla 3.1 模块。我需要知道如何获取当前类别 id、父类别 id、当前页面 id。请有人告诉我该怎么做。感谢您的提前
【问题讨论】:
标签: joomla
从这里开始,请容忍一些不准确的地方,但它应该足以让你继续前进。
$input = JFactory::getApplication()->input;
// should be article, categories, featured, blog...
$view = $input->get('view');
// if it's a category view, this will be the category id, else the article id
$id = $input->getInt('id');
// in an article view, this will be the cat id.
$catid = $input->getInt('catid');
// this is the menu item id i.e. what you call page id I guess.
$Itemid = $input->getInt('Itemid');
【讨论】: