Neos\Flow\Http\Uri::setFragment PHP Метод

setFragment() публичный Метод

Sets the fragment in the URI
public setFragment ( string $fragment ) : void
$fragment string The fragment (aka "anchor")
Результат void
    public function setFragment($fragment)
    {
        if (preg_match(self::PATTERN_MATCH_FRAGMENT, $fragment) === 1) {
            $this->fragment = $fragment;
        } else {
            throw new \InvalidArgumentException('"' . $fragment . '" is not valid fragment as part of a URI.', 1184071252);
        }
    }

Usage Example

Пример #1
0
 /**
  * Tries to detect the base URI of request.
  *
  * @return void
  */
 protected function detectBaseUri()
 {
     if ($this->baseUri === null) {
         $this->baseUri = clone $this->uri;
         $this->baseUri->setQuery(null);
         $this->baseUri->setFragment(null);
         $this->baseUri->setPath($this->getScriptRequestPath());
     }
 }