class MailchimpSignupRoutes in Mailchimp 2.x
Same name and namespace in other branches
- 8 modules/mailchimp_signup/src/Routing/MailchimpSignupRoutes.php \Drupal\mailchimp_signup\Routing\MailchimpSignupRoutes
Defines dynamic routes for Mailchimp signup forms rendered as pages.
Hierarchy
- class \Drupal\mailchimp_signup\Routing\MailchimpSignupRoutes
Expanded class hierarchy of MailchimpSignupRoutes
File
- modules/
mailchimp_signup/ src/ Routing/ MailchimpSignupRoutes.php, line 10
Namespace
Drupal\mailchimp_signup\RoutingView source
class MailchimpSignupRoutes {
/**
* {@inheritdoc}
*/
public function routes() {
$routes = [];
$signups = mailchimp_signup_load_multiple();
/* @var $signup \Drupal\mailchimp_signup\Entity\MailchimpSignup */
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;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MailchimpSignupRoutes:: |
public | function |