You are here

public function CampaignMonitorUserRouteProvider::routes in Campaign Monitor 8

1 string reference to 'CampaignMonitorUserRouteProvider::routes'
campaignmonitor_user.routing.yml in modules/campaignmonitor_user/campaignmonitor_user.routing.yml
modules/campaignmonitor_user/campaignmonitor_user.routing.yml

File

modules/campaignmonitor_user/src/Routing/CampaignMonitorUserRouteProvider.php, line 15

Class

CampaignMonitorUserRouteProvider
Provides routes for the user entity.

Namespace

Drupal\campaignmonitor_user\Routing

Code

public function routes() {
  $config = \Drupal::config('campaignmonitor_user.settings');
  $routes = [];

  // Returns an array of Route objects.
  $routes['campaignmonitor.user.subscriptions'] = new Route('/user/campaignmonitor', [
    '_controller' => '\\Drupal\\campaignmonitor_user\\Controller\\CampaignMonitorUserController::subscriptionPage',
    '_title' => $config
      ->get('subscription_heading'),
  ], [
    'user' => '\\d+',
    '_user_is_logged_in' => 'TRUE',
  ]);
  $routes['campaignmonitor.user.subscriptions_edit'] = new Route('/user/campaignmonitor/{user}/edit', [
    '_form' => '\\Drupal\\campaignmonitor_user\\Form\\CampaignMonitorUserSubscriptionForm',
    '_title' => $config
      ->get('subscription_heading'),
  ], [
    'user' => '\\d+',
    '_user_is_logged_in' => 'TRUE',
  ]);
  return $routes;
}