You are here

class CampaignMonitorUserRouteProvider in Campaign Monitor 8

Provides routes for the user entity.

Hierarchy

Expanded class hierarchy of CampaignMonitorUserRouteProvider

File

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

Namespace

Drupal\campaignmonitor_user\Routing
View source
class CampaignMonitorUserRouteProvider {

  /**
   * {@inheritdoc}
   */
  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;
  }

}

Members