components/Helper.php
public static function filter($items, $user = null)
    {
        if ($user === null) {
            $user = Yii::$app->getUser();
        }
        return static::filterRecursive($items, $user);
    }
public static function filter($items, $user = null)
    {
        if ($user === null) {
            $user = Yii::$app->getUser();
        }
        return static::filterRecursive($items, $user);
    }
public static function filter ( $ items , $ user = null ) { if ( $ user === null ) { $ user = Yii :: $ app -> getUser ( ) ; } return static :: filterRecursive ( $ items , $ user ) ; }
Filter menu items
@param array $items
@param integer|User $user
Filter menu items