Jump to:

23355 Posts in 17744 Topics by 2862 members

General Questions

SilverStripe Forums » General Questions » How to get $this->PageID ?

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: 816 Views
  • Rawbit
    Avatar
    Community Member
    52 Posts

    How to get $this->PageID ? Link to this post

    I have a function inside Page_Controller( .... function myFunction(...)) and I want the Id of the page in question. I tried $this->PageID but that of course tries to access the Page_controller when really I want it from Class Page()

    Know what I mean?

  • ajshort
    Avatar
    Community Member
    244 Posts

    Re: How to get $this->PageID ? Link to this post

    You can just call $this->ID on the controller - it will automatically failover to the Page object.

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