flaho
(Patrice)
1
I have a rest api
for a simple word action, there is no problem.
Ex : EmailController -> rest api : api/emails, no problem
But for multipleWords an error 404 page not found.
Ex : EmailTemplateController -> rest api : api/emailtemplates, error 404
Any idea how to solve this issue ?
thanks
flaho
(Patrice)
2
I reply to myself.
I found a way
in app/config/web.php
You can add a rule :
$config = [
...
'components' => [
'urlManager' => [
'enablePrettyUrl' => true,
'enableStrictParsing' => true,
'showScriptName' => false,
'rules' => [
...
[
'class' => 'yii\rest\UrlRule',
'pluralize' => false,
'controller' => ['emailtemplates' => 'email-template'], // email-template refers to EmailTemplateController
],
...
]
...
]
...
]
...
]
evstevemd
(Stefano Mtangoo)
3
Should be
EmailTemplateController -> rest api :[b] api/email-templates
[/b]