예제 #1
0
 private function _checkUrl($url)
 {
     if (empty($url)) {
         return Url::redirect(Url::getRoot('public'));
     }
     return filter_var($url, FILTER_SANITIZE_URL);
 }
예제 #2
0
<?php

/*
 * Public errors handling
 */
use WebSupportDK\PHPHttp\Url;
switch (Url::getError()) {
    case 404:
        Url::redirect(Url::getRoot('public') . 'error/code/404');
        break;
    case 42:
        Url::redirect(Url::getRoot('public') . 'error/code/42');
        break;
    default:
        break;
}