joomla 2.5에 새 기사를 만들고 해당 기사를 메뉴 항목에 추가하는 구성 요소를 만들었습니다.프로그래밍 방식으로 줌라에 메뉴 항목 만들기
문서를 만드는 데는 문제가 없지만 메뉴 항목을 만드는 데는 문제가 있습니다.
//add the article to a menu item
$menuTable = JTable::getInstance('Menu', 'JTable', array());
$menuData = array(
'menutype' => 'client-pages',
'title' => $data[name],
'type' => 'component',
'component_id' => 22,
'link' => 'index.php?option=com_content&view=article&id='.$resultID,
'language' => '*',
'published' => 1,
'parent_id' => '1',
'level' => 1,
);
// Bind data
if (!$menuTable->bind($menuData))
{
$this->setError($menuTable->getError());
return false;
}
// Check the data.
if (!$menuTable->check())
{
$this->setError($menuTable->getError());
return false;
}
// Store the data.
if (!$menuTable->store())
{
$this->setError($menuTable->getError());
return false;
}
오류가 PARENT_ID 및 레벨을 설정하여 것 같다 :
나는 다음과 같은 코드가 있습니다.
경고 : str_repeat() [function.str 반복] : 두 번째 인수를 0으로 PARENT_ID 및 레벨을 설정 tablenested.php 라이브러리/줌라/데이터베이스/디버깅이 내 관리자 페이지에 다음과 같은 오류가 발생 라인 /Applications/MAMP/htdocs/joomla_2_5/administrator/components/com_menus/views/items/tmpl/default.php 0보다 크거나 같아야하는 것은 129
그것은 오류 메시지가 당신이 뭘 잘못했는지 꽤 구체적인 것을 것 같습니다. 그게 뭐가 문제 야? – hakre
오류 메시지가 joomla 코어 파일을 가리키고 있기 때문에 거기에서 해킹하고 싶지 않습니다. 나는 왜 내가 joomla 코어가 내 parent_id와 레벨을 0으로 재설정 유지하는지에 대한 문제를 해결할 필요가 있다고 생각한다. –