public function redirect($url)
    {
        if (preg_match(STATIC_URL_REGEX, $url)) {
            return $this->registerScript('window.location.replace("' . $url . '");');
        }
        return $this->registerScript('$.router.replace("' . $url . '");');
    }