How do I grab the page number in the controller of my php code and also set it?
The current page number will be in the Controller params
.
Try debugging it to view its contents, or using the DebugKit:
// Within your controller action:
debug($this->request->params);