【发布时间】:2014-07-11 07:40:20
【问题描述】:
我想绑定内容项表的id并链接菜单表。我需要按如下方式构建查询:
protected function getListQuery()
{
$url="index.php?option=com_content&view=article&id=";
// Create a new query object.
$db = JFactory::getDBO();
$query = $db->getQuery(true);
// select the items
$query->select('ar.id,ar.alias,ar.introtext,ar.images,ar.created,m.link,m.path');
// of content table and menu table
$query->from('#__content as ar, #__menu as m');
$query->where('m.link like '+$url+'ar.id');
$query->order('ar.id desc');
return $query;
}
查询返回 0 个结果。我需要附加$url 参数和ar.id 来生成我找到完整的url。
我想让你给我看的表中的菜单项列表都链接到参数。 例如:
index.php?option=com_content&view=article&id=70
谢谢!
【问题讨论】:
标签: php mysql joomla joomla2.5