Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Overwritting HTTP::setGetVar()


Go to End


2 Posts   1268 Views

Avatar
WebSpilka

Community Member, 89 Posts

29 November 2015 at 3:22am

Hi
How can I override /framework/control/HTTP.php function setGetVar
I need change

$params[$varname] = $varvalue;

to
		if ($varname === 'start' && $varvalue === 0){
			unset($params[$varname]);
		}else{
			$params[$varname] = $varvalue;
		}

This code helps to improve SEO for pagination first link
It change URL Link :
/{MyNewsHolderURL}/?start=0
to
/{MyNewsHolderURL}/

Avatar
Devlin

Community Member, 344 Posts

2 December 2015 at 4:47am

Why not override PaginatedList instead?