• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Documentation error | Limit the Routes Made

#1
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?
Reply

#2
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
Reply

#3
(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.
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

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?
Reply

#4
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.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.