I've encounterd a problem with URL creation.
In my plugin I have the following.
public function registerSiteRoutes() {
return [
'korting/zoeken' => array('action' => '/discount/discount/index'),
'korting/(?P<id\d+>)-(?P<slug>[a-zA-Z0-9-]+)' => array('action' => 'discount/discount/view',),
];
}
Now when I'm at the frontend, I use the following to create the URL :
{{ url('/discount/discount/view',{id:entry.id,slug:entry.slug}) }}
My plugin gets its data from a solarium document, so its no entry.
I would expect that my URL would become neat like :
/korting/124-test-1
but instead I get :
/korting?id=124&slug=test-1
This feature is build in by default in the Yii URL manager, but Craft doesn't make use of it. This is resulting in my problem that Craft doesn't have the abbility to make pathed URLs.
Is there any other way for me to do this?