我想为我自己的网站为joomla 3.1创建一个模块.我需要知道如何获取当前类别ID,父类别ID,当前页面ID.请有人告诉我该怎么做.谢谢你的进步
Ric*_*orn 18
从记忆中走出来,请承担一些不准确之处,但它应该足以让你去.
$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');
Run Code Online (Sandbox Code Playgroud)