Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

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

show id in Page_Controller


2 Posts   1175 Views


16 July 2010 at 10:09pm Community Member, 192 Posts


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



17 July 2010 at 9:45am Community Member, 243 Posts

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: