Documentation error | Limit the Routes Made |
Hello, where can i report errors in the documentation?
In topic Limit the Routes MadeĀ on the link: https://codeigniter.com/user_guide/incoming/restful.html#limit-the-routes-made PHP Code: $routes->resource('photos', ['except' => 'new,edit']); I believe it should be: PHP Code: $routes->resource('photos', ['except' => ['new', 'edit']]); I performed a test and it is not working as in the documentation, changing only the code above. Or am I mistaken?
According to the documentation both of those options should be viable. So they bug would be why , dosen't work.
You can open an Issue at our Github page, if there aren't any of that specific topic already. https://github.com/codeigniter4/CodeIgniter4/issues
(04-19-2020, 06:26 AM)jreklund Wrote: According to the documentation both of those options should be viable. So they bug would be why , dosen't work. Hello, jreklund The problem was this: PHP Code: $routes->resource('photos', ['only' => 'index, show']); The space between items in the string Do you think it would be interesting to prevent this? Or better leave it as is?
Hi MatheusCastro,
Personally I would not classify this as a bug, as many of our function require you to have no space between a comma separated list (if matched with an absolute value). Or | separated list. We don't know if you wanted that space there to begin with. :-) It can technically be fixed by trimming white space characters. Personally I don't know why we even support that, in that function. The only place I can see the use are in the validation, as you pass it along as an complete string. I don't see why this weren't just designed to accept an array as it's a complete new function, not a legacy one. |
Welcome Guest, Not a member yet? Register Sign In |