Jump to:

23490 Posts in 18996 Topics by 2878 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: 836 Views
  • Rawbit
    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
    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.

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.