Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Allow SiteTree::Link to be extended #1952

Merged
merged 1 commit into from
Sep 4, 2017

Conversation

tractorcow
Copy link
Contributor

This is necessary to allow post-baseurl applied links to be modified.

Useful for modules such as subsites / fluent which may need to prepend domain names.


public function updateLink(&$link, $action = null)
{
$link = Controller::join_links($link, '?extra=1');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to see a unit test prepending to the link, to cover what you're intending for this extension point as well.

@tractorcow
Copy link
Contributor Author

Done @flamerohr :D

@flamerohr flamerohr merged commit 24a8cfb into silverstripe:4 Sep 4, 2017
@flamerohr flamerohr deleted the pulls/4.0/extend-link branch September 4, 2017 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants