MailchimpSignupRoutes.php in Mailchimp 8
File
modules/mailchimp_signup/src/Routing/MailchimpSignupRoutes.php
View source
<?php
namespace Drupal\mailchimp_signup\Routing;
use Symfony\Component\Routing\Route;
class MailchimpSignupRoutes {
public function routes() {
$routes = [];
$signups = mailchimp_signup_load_multiple();
foreach ($signups as $signup) {
if (intval($signup->mode) == MAILCHIMP_SIGNUP_PAGE || intval($signup->mode) == MAILCHIMP_SIGNUP_BOTH) {
$routes['mailchimp_signup.' . $signup->id] = new Route('/' . $signup->settings['path'], [
'_controller' => '\\Drupal\\mailchimp_signup\\Controller\\MailchimpSignupController::page',
'_title' => $signup->title,
'signup_id' => $signup->id,
], [
'_permission' => 'access mailchimp signup pages',
]);
}
}
return $routes;
}
}