public function registerCpUrlRules(RegisterUrlRulesEvent $event)
    {
        // only register CP URLs if the user is logged in
        if (!\Craft::$app->user->identity)
            return;
        
        $rules = [

            // register routes for the settings tab
            'settings/sitemap' => [
                'route'=>'sitemap/settings',
                'params'=>['source' => 'CpSettings']],
            'settings/sitemap/save-sitemap' => [
                'route'=>'sitemap/settings/save-sitemap',
                'params'=>['source' => 'CpSettings']],
        ];
        $event->rules = array_merge($event->rules, $rules);
    }
public function registerCpUrlRules(RegisterUrlRulesEvent $event)
    {
        // only register CP URLs if the user is logged in
        if (!\Craft::$app->user->identity)
            return;
        
        $rules = [

            // register routes for the settings tab
            'settings/sitemap' => [
                'route'=>'sitemap/settings',
                'params'=>['source' => 'CpSettings']],
            'settings/sitemap/save-sitemap' => [
                'route'=>'sitemap/settings/save-sitemap',
                'params'=>['source' => 'CpSettings']],
        ];
        $event->rules = array_merge($event->rules, $rules);
    }
public function registerCpUrlRules ( RegisterUrlRulesEvent $ event ) { // only register CP URLs if the user is logged in if ( ! \ Craft :: $ app -> user -> identity ) return ; $ rules = [ // register routes for the settings tab 'settings/sitemap' => [ 'route' => 'sitemap/settings' , 'params' => [ 'source' => 'CpSettings' ] ] , 'settings/sitemap/save-sitemap' => [ 'route' => 'sitemap/settings/save-sitemap' , 'params' => [ 'source' => 'CpSettings' ] ] , ] ; $ event -> rules = array_merge ( $ event -> rules , $ rules ) ; }
Register CP URL rules

@param RegisterUrlRulesEvent $event
Register CP URL rules