Jump to:

23481 Posts in 18965 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Built string in Page_Controller

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 1020 Views
  • Karai
    Community Member
    13 Posts

    Built string in Page_Controller Link to this post


    I'm trying to set up a website that requires some unpleasant URLs and I want to rebuild them in the controller and output them that way.

    // current output

    Sometimes this can say pretty bad things like 'send-me-more?package=Something goes here & here' which is obviously bad, since when I pull $_GET['package'] out of the url, it stops at the &.

    //desired output

    any ideas on how to do this?

  • Willr
    Forum Moderator
    5503 Posts

    Re: Built string in Page_Controller Link to this post

    well $Title would have to be escaped to convert the &'s to & which you could do in PHP with the url_encode() function. You can do this in the template by calling URLATT. eg $Title.URLATT with should convert the elements for the url.

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.