Jump to:

23459 Posts in 18906 Topics by 2877 members

General Questions

SilverStripe Forums » General Questions » show id 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: 1158 Views
  • bebabeba
    Community Member
    192 Posts

    show id in Page_Controller Link to this post


    how can print id page in my Page_Controller?
    I create a funcion that retun $this->ID in my template but i see nothing..help please..


  • Pigeon
    Community Member
    243 Posts

    Re: show id in Page_Controller Link to this post

    I'm not sure exactly what you are trying to do, but...

    To print the current page ID in the template do this:


    to access it in the controller or model of the page do:


    or in a model or controller that isnt the page:


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.