Repository navigation
Added event listener to toggle TL_VIEW cookie - #26
Conversation
|
Looks good, but you are not following the coding style and you have forgotten to add a test :) |
|
I've fixed the yoda conditions and added unit tests. |
There was a problem hiding this comment.
It should say: Sets the TL_VIEW cookie based on the "toggle_view" query parameter. (Also note the full stop at the end).
There was a problem hiding this comment.
If the user input is valid, toggle_view will be a string already ("mobile" or "desktop"). Otherwise the comparison will fail anyways, so the cast is actually not necessary.
There was a problem hiding this comment.
Well the @return statement of the ParameterBag says it can be mixed…
There was a problem hiding this comment.
This might be true, but it is still irrelevant. If $state is not a string, the comparison will fail. And that's correct.
There was a problem hiding this comment.
Lines 118 and 119 should be equally aligned.
There was a problem hiding this comment.
@aschempp If you fix this last CS error, I can merge the PR.
|
Thanks for applying all the changes. There's one remaining issue: BTW, should we use the |
|
Contao namespace! The global one is just for BC. |
|
I've stumbled upon the namespace question too. I'd go for Contao namespace, but that's currently not the case anywhere… |
|
I know, because I wasn't sure either. I'll happily change it though :) |
|
Fixed last issue, you can merge it now :-) |
I started reviewing/working on the routing feature and stumbled over this part. The only difference I can see is the toggle action is executed everywhere and not only for regular pages, but I don't think that would be a problem?