You are here

interface PathValidatorInterface in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Path/PathValidatorInterface.php \Drupal\Core\Path\PathValidatorInterface

Provides an interface for url path validators.

Hierarchy

Expanded class hierarchy of PathValidatorInterface

All classes that implement PathValidatorInterface

6 files declare their use of PathValidatorInterface
LinkFormatter.php in core/modules/link/src/Plugin/Field/FieldFormatter/LinkFormatter.php
Contains \Drupal\link\Plugin\Field\FieldFormatter\LinkFormatter.
MenuLinkContentForm.php in core/modules/menu_link_content/src/Form/MenuLinkContentForm.php
Contains \Drupal\menu_link_content\Form\MenuLinkContentForm.
PathFormBase.php in core/modules/path/src/Form/PathFormBase.php
Contains \Drupal\path\Form\PathFormBase.
Route.php in core/modules/migrate/src/Plugin/migrate/process/Route.php
Contains \Drupal\migrate\Plugin\migrate\process\Route.
ShortcutSetController.php in core/modules/shortcut/src/Controller/ShortcutSetController.php
Contains \Drupal\shortcut\Controller\ShortcutSetController.

... See full list

File

core/lib/Drupal/Core/Path/PathValidatorInterface.php, line 13
Contains \Drupal\Core\Path\PathValidatorInterface.

Namespace

Drupal\Core\Path
View source
interface PathValidatorInterface {

  /**
   * Returns an URL object, if the path is valid and accessible.
   *
   * @param string $path
   *   The path to check.
   *
   * @return \Drupal\Core\Url|false
   *   The url object, or FALSE if the path is not valid.
   */
  public function getUrlIfValid($path);

  /**
   * Returns an URL object, if the path is valid.
   *
   * Unlike getUrlIfValid(), access check is not performed. Do not use this
   * method if the $path is about to be presented to a user.
   *
   * @param string $path
   *   The path to check.
   *
   * @return \Drupal\Core\Url|false
   *   The url object, or FALSE if the path is not valid.
   */
  public function getUrlIfValidWithoutAccessCheck($path);

  /**
   * Checks if the URL path is valid and accessible by the current user.
   *
   * @param string $path
   *   The path to check.
   *
   * @return bool
   *   TRUE if the path is valid.
   */
  public function isValid($path);

}

Members

Namesort descending Modifiers Type Description Overrides
PathValidatorInterface::getUrlIfValid public function Returns an URL object, if the path is valid and accessible. 1
PathValidatorInterface::getUrlIfValidWithoutAccessCheck public function Returns an URL object, if the path is valid. 1
PathValidatorInterface::isValid public function Checks if the URL path is valid and accessible by the current user. 1