Jump to:

23007 Posts in 11866 Topics by 2828 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: 967 Views
  • Karai
    Avatar
    Community Member
    13 Posts

    Built string in Page_Controller Link to this post

    Hey,

    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
    send-me-more?package=$Title

    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
    $SendTitle

    any ideas on how to do this?

  • Willr
    Avatar
    Forum Moderator
    5464 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.

    967 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.