Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Loc.php
Go to the documentation of this file.
1 <?php
26 #require_once 'Zend/Validate/Abstract.php';
27 
31 #require_once 'Zend/Uri.php';
32 
45 {
50  const NOT_VALID = 'sitemapLocNotValid';
51  const INVALID = 'sitemapLocInvalid';
52 
58  protected $_messageTemplates = array(
59  self::NOT_VALID => "'%value%' is not a valid sitemap location",
60  self::INVALID => "Invalid type given. String expected",
61  );
62 
71  public function isValid($value)
72  {
73  if (!is_string($value)) {
74  $this->_error(self::INVALID);
75  return false;
76  }
77 
78  $this->_setValue($value);
80  if ($result !== true) {
81  $this->_error(self::NOT_VALID);
82  return false;
83  }
84 
85  return true;
86  }
87 }
static check($uri)
Definition: Uri.php:72
_error($messageKey, $value=null)
Definition: Abstract.php:284
$value
Definition: gender.phtml:16