Add zrl parameter support #41
No reviewers
Labels
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: friendica/friendica-directory#41
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "task/24-add-zrl-parameter-support"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. 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.