How to setup custom site routes created by user in plugin settings
You can use the registerSiteRoutes() hook in your plugin's primary class.

Assuming your custom URL formats are stored in an array in a plugin setting called customRoutes (use AttributeType::Mixed for arrays), and that the array consists of key/value paired routes and template paths:

public function registerSiteRoutes()
{
    return $this-&gt;getSettings()['customRoutes'] ?: array();
}


Here's how the customRoutes array should look:

array(
    'some-custom-route' =&gt; '_some-custom-template',
    'another-custom-route' =&gt; '_another-custom-template',
),