public static Url::fromUserInput($user_input, $options = [])
Creates a Url object for a relative URI reference submitted by user input.
Use this method to create a URL for user-entered paths that may or may not correspond to a valid Drupal route.
Parameters
string $user_input: User input for a link or path. The first character must be one of the following characters:
'/': A path within the current site. This path might be to a Drupal route (e.g., '/admin'), to a file (e.g., '/README.txt'), or