我正在写一个 Joomla!我需要在其中显示当前文章标题的模块。
我在stackoverflow的某个地方找到了这段代码:
<?php
$option = JRequest::getCmd('option');
$view = JRequest::getCmd('view');
$ids = explode(':',JRequest::getString('id'));
$article_id = $ids[0];
$article =& JTable::getInstance("content");
$article->load($article_id);
echo $article->get("title");
?>
虽然它有效,但它使用了已弃用的 JRequest 类,因为它来自 Joomla 1.7 而我使用的是 3.2.2。有人可以告诉我如何重写它以使 Joomla 3.2 有效吗?