Routes

Studioforty9_Recaptcha_Model_Routes

add( $route, $label )

Add a new route.

ParameterTypeExample
$routestring'contacts_index_index'
$labelstring'Contact Form'
<?php

$routes->add('contacts_index_index', 'Contact Form');

remove ( $route )

Remove a route.

ParameterTypeExample
$routestring'contacts_index_index'
<?php

$routes->remove('contacts_index_index');

find( $route )

Find a route.

🚧

Throws an exception when route cannot be found

Exception Class: Exception
Exception Message: $route could not be found or was not allocated.

ParameterTypeExample
$routestring'contacts_index_index'
<?php

try {
  $route = $routes->find('contacts_index_index');
} catch (Exception $e) {}

clear()

Clear all routes.

<?php

$routes->clear();

count()

Count the number of routes stored on the object.

<?php

$routes->count();

toArray()

Cast the routes object to an array. Perfect for use in a multi-select field :)

<?php

$routes->toArray();