Join GitHub today
no documented way of clearing a route's default/option/requirements #20296
Well I suppose one of:
a) there is a way to clear a requirement (either NULL, or something else I'm not aware of). The docs should be fixed to mention this.
@joachim-n I've tested your code and it doesn't work for me:
$route->getOption('foo'); // 'bar' $route->hasOption('foo')); // true $route->setOption('foo', null); $route->hasOption('foo')); // true $route->getOption('foo'); // null
It's a bit cumbersome, but you could do this to remove some options:
My only question would be: is this feature something needed that should be implemented ... or is it an edge-case and we can ignore it? Thanks!