Guest User

Untitled

a guest
Apr 25th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. class AwardWinnersPage_Controller extends RedirectorPage_Controller {
  2. function init() {
  3. $page = DataObject::get_one('AwardsPage', '', '', 'year DESC, term DESC');
  4. $urlId = Director::URLParam('ID');
  5. $urlAction = Director::URLParam('Action');
  6. var_dump($urlId); die();
  7. if($urlId !== null) {
  8. Director::redirect($page->AbsoluteLink() . '/' . $urlAction . '/' . $urlId);
  9. } else {
  10. Director::redirect($page->AbsoluteLink());
  11. }
  12.  
  13. $this->LinkToID = $page->ID;
  14. parent::init();
  15. }
  16.  
  17. }
Add Comment
Please, Sign In to add comment