Add zrl parameter support #41
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: friendica/friendica-directory#41
Loading…
Reference in a new issue
No description provided.
Delete branch "task/24-add-zrl-parameter-support"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #24
I've long wondered how to best support the
zrl
parameter within the Slim framework context. I was stuck for a while because I needed to find the intersection of the Request object that contains the query parameter, the Router to generate URLs for routes including the parameter, and the Renderer to append the parameter to external URLs (not handled by the internal router).The solution was to use a midlleware class to extract the query string parameter from the request and store it as an attribute of the Renderer, then have the Router be a dependency of the Renderer, then write two Renderer helper methods to append automatically the zrl parameter to route URLs and external URLs repsectively.
Then I had to replace all the hard-coded URLs in the templates with either method calls.
In the end, it was easier than I initially expected, but it took me a while to wrap my head around the dependency injection philosophy I'm trying to use through Slim.
91 files? Uff
It's mostly the email change. :-)
Yeah, going commit by commit is recommended.