Jump to:

3432 Posts in 1025 Topics by 865 members

Template Questions

SilverStripe Forums » Template Questions » Control $action

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

Page: 1
Go to End
Author Topic: 743 Views
  • kuenkuen82
    Avatar
    Community Member
    41 Posts

    Control $action Link to this post

    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;
       }

  • kuenkuen82
    Avatar
    Community Member
    41 Posts
    743 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.