我在这一行ng-repeat
当用户退出时,我收到了该错误,但是当我登录时,我没有收到错误。
'href' => 'index.php?action=profile&user='.escape($user->data()->username).'',
答案 0 :(得分:1)
您必须先检查条件
代码:
function toolbar_section()
{
$user = new User();
global $variables;
if(count($user) > 0)
{
$href = 'index.php?action=profile&user='.escape($user->data()->username).'';
}
else
{
$href = 'index.php?action=profile&user='.escape("abc").'';
}
$variables['menu_buttons'] = array(
'home' => array(
'title' => 'Pocetna',
'href' => 'index.php',
'show' => true,
),
'profile' => array(
'title' => 'Profil',
'href' => $href,
'logged' => true,
),
'logout' => array(
'title' => 'Odjava',
'href' => 'index.php?action=logout',
'logged' => true,
),
);
}