public function purge(PerchContent_Page $Page)
 {
     $Settings = $this->api->get('Settings');
     $siteURL = $Settings->get('siteURL')->val();
     $url = parse_url($siteURL);
     if (!isset($url['protocol'])) {
         $siteURL = 'http' . (isset($_SERVER['HTTPS']) ? 's' : '') . '://' . $_SERVER['HTTP_HOST'];
     }
     $siteURL = rtrim($siteURL, '/');
     $this->issue_purge_request($siteURL . $Page->pagePath());
     $Routes = new PerchPageRoutes();
     $routes = $Routes->get_routes_for_page($Page->id());
     if (PerchUtil::count($routes)) {
         $Router = new PerchRouter();
         foreach ($routes as $Route) {
             if (substr($Route->routeRegExp(), 0, 1) != '^') {
                 $this->issue_purge_request($siteURL . '/' . $Route->routePattern());
             } else {
                 $posix = $Router->pattern_to_regexp($Route->routePattern(), true);
                 $this->issue_ban_request($siteURL, $posix);
             }
         }
     }
 }
                    } else {
                        $PageRoute->delete();
                    }
                }
            }
            $new_routes = $Form->receive(array('new_pattern'));
            if (count($new_routes)) {
                foreach ($new_routes as $pattern) {
                    if (trim($pattern) != '') {
                        $PageRoute = $PageRoutes->create(array('pageID' => $Page->id(), 'routePattern' => $pattern));
                    }
                }
            }
            $Form->reset_field('new_pattern');
        }
        $Alert->set('success', PerchLang::get('Successfully updated'));
    }
}
$created = false;
if (isset($_GET['created'])) {
    $Alert->set('success', PerchLang::get('Your page has been successfully created. Return to %spage listing%s', '<a href="' . PERCH_LOGINPATH . '/core/apps/content/">', '</a>'));
    $created = true;
}
$Roles = new PerchUserRoles();
$roles = $Roles->all();
$details = $Page->to_array();
$navgroups = $NavGroups->all();
if (PERCH_RUNWAY) {
    $routes = $PageRoutes->get_routes_for_page($Page->id());
    $collections = $Collections->all();
}