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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Template Questions /

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

Control $action


Go to End


2 Posts   1250 Views

Avatar
kuenkuen82

Community Member, 41 Posts

9 December 2010 at 5:20pm

I have a control in the template that loops through a number of objects and call the object action (function). The function should only return html, but I'm finding that in the anchor tag in the href attr as the complete URL.

How do I remove this?

	function Output(){
		
		$tab_title = '';
		$tab_content = '';

		foreach($this->getComponents('TabContent') as $key => $tab){
			
			$tab_title .= '<li><a href="#tab-'.$key.'">'.$tab->Name.'</a></li>';
			$tab_content .= '<div id="tab-'.$key.'">'.$tab->Content.'</div>';
			
		}
		
		$tab_title = '<ul>'.$tab_title.'</ul>';
		$tab_content = ''.$tab_content.'';
		
		$rawHTML = '<div id="tabs">'.$tab_title.$tab_content.'</div>';
		return $rawHTML; 
	}

Avatar
kuenkuen82

Community Member, 41 Posts

9 December 2010 at 5:37pm