src/Validate.php
public static function url($input, $field_name = 'url')
    {
        //Define trivial model
        $model = [
            $field_name => ['type' => Validate::TYPE_URL, Validate::REQUIRED]
        ];

        $parameters = [$field_name => $input];
        Validate::model($parameters, $model);

        return $parameters[$field_name];
    }
public static function url($input, $field_name = 'url')
    {
        //Define trivial model
        $model = [
            $field_name => ['type' => Validate::TYPE_URL, Validate::REQUIRED]
        ];

        $parameters = [$field_name => $input];
        Validate::model($parameters, $model);

        return $parameters[$field_name];
    }
public static function url ( $ input , $ field_name = 'url' ) { //Define trivial model $ model = [ $ field_name => [ 'type' => Validate :: TYPE_URL , Validate :: REQUIRED ] ] ; $ parameters = [ $ field_name => $ input ] ; Validate :: model ( $ parameters , $ model ) ; return $ parameters [ $ field_name ] ; }
Validate a url
@param string $input
@param string $field_name [optional] Field's name, used in IncorrectParametersException.
Optional default is url
@return string Return the url
@throws IncorrectParameters If value type is not correct.
Validate a url