You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How come in the first console.log, the undefined parameter has no value and the second has literally the "undefined" string value? I would like my second generated rule to be the same as the first one, how can I do it?
Why is the index parameter ignored in the routing generation when the first parameter is undefined? Can someone help me to add the second routing paramater even if the first is undefined?
Thanks.
The text was updated successfully, but these errors were encountered:
The index parameter is not ignored in the routing when the first parameter is undefined. It is removed from the generated URL when it is equal to its default value, which is the behavior of the Symfony router too (which is why the JS does it).
The URL generated with index = 2cannot be the same than the first one, because you would get index = 1 on the PHP side when matching the URL.
And regarding the first parameter, you see undefined in the second case, because this is what casting undefined to string produces in JS. In the first case, you don't have it, because it seems like the JS code considers that undefined is equal to the null default value, and so skips the optional parameter (because all optional parameters after it are skipped).
Hi,
I have a route in my symfony project that I wrote below:
And in my javascript, I have got this function:
And this is what my console prints:
I have two questions/issues about theses facts.
How come in the first console.log, the undefined parameter has no value and the second has literally the "undefined" string value? I would like my second generated rule to be the same as the first one, how can I do it?
Why is the index parameter ignored in the routing generation when the first parameter is undefined? Can someone help me to add the second routing paramater even if the first is undefined?
Thanks.
The text was updated successfully, but these errors were encountered: