ElggMenuItem::setSection PHP Method

setSection() public method

Set the section identifier
public setSection ( string $section ) : void
$section string The identifier of the section
return void
    public function setSection($section)
    {
        $this->data['section'] = $section;
    }

Usage Example

示例#1
0
/**
 * Add to the user hover menu
 */
function logbrowser_user_hover_menu($hook, $type, $return, $params)
{
    $user = $params['entity'];
    $url = "admin/overview/logbrowser?user_guid={$user->guid}";
    $item = new ElggMenuItem('logbrowser', elgg_echo('logbrowser:explore'), $url);
    $item->setSection('admin');
    $return[] = $item;
    return $return;
}
All Usage Examples Of ElggMenuItem::setSection