Adds a prefix to the route.

@param  string                   $prefix Route prefix
@return \mako\http\routing\Route
433168
public function prefix(string $prefix): Route
	{
		if(!empty($prefix))
		{
			$this->prefix .= '/' . trim($prefix, '/');
		}

		return $this;
	}
1357909
public function setPrefix(string $prefix): PageInterface
    {
        $this->prefix = $prefix;

        $this->repository()->getSettings()->collapse()->each(function ($setting) use ($prefix) {
            /** @var $setting FieldTypeInterface */
            $setting->setPrefix($prefix);
        });

        return $this;
    }
623761
public function setPrettyName($name, $prefix = true)
    {
        if (empty($name)) {
            return $this;
        }

        $this->prettyName = $this->urlize($name);
        $this->prettyPrefix = $prefix;

        return $this;
    }
614069
public static function setPrefix($prefix)
    {
        if (!empty($prefix) && is_string($prefix)) {
            self::$prefix = $prefix;
            return true;
        }

        return false;
    }
856398
public function find_by_prefix($prefix) {
        $return = [];
        foreach ($this->find_all() as $key) {
            if (strpos($key, $prefix) === 0) {
                $return[] = $key;
            }
        }
        return $return;
    }
369155
public function prefix($prefix)
    {
        $uri = rtrim($prefix, '/').'/'.ltrim($this->uri, '/');

        $this->uri = trim($uri, '/');

        return $this;
    }
1232407
public function prefix(string $prefix) {
        if ($this->running) {
            throw new \Error("Cannot alter routes after the server has started");
        }

        $prefix = \trim($prefix, "/");

        if ($prefix !== "") {
            $this->prefix = "/" . $prefix . $this->prefix;
        }
    }
911527
public function prefixKey($prefix)
    {
        if (empty($this->key)) {
            $this->key = $prefix;
        } else {
            $this->key = $prefix . '.' . $this->key;
        }

        return $this;
    }
1204353
public function prefix($prefix = null)
    {
        if (null !== $prefix) {
            $this->prefix = substr(md5($prefix), 0, 10) . '_';
        }

        return $this->prefix;
    }
515294
public static function checkUrlPrefix($prefix) {
        return isset(self::$prefix['check'][ $prefix ]) ? self::$prefix['check'][ $prefix ] : null;
    }
1168265
public function setPrefix($prefix)
    {
        if (!is_string($prefix)) {
            throw new InvalidArgumentException(
                'Prefix must be a string'
            );
        }

        /** @see \Stash\Pool\::setNamespace */
        if (!ctype_alnum($prefix)) {
            throw new InvalidArgumentException(
                'Prefix must be alphanumeric'
            );
        }

        $this->prefix = $prefix;
        return $this;
    }
1103449
public function formatHeaderAndRemovePrefix($header, $prefix = 'HTTP_') {
        if (str_starts_with($header, $prefix)) {
            $header = substr($header, strlen($prefix));
        }

        return $this->formatHeader($header);
    }
241285
public function setPrefix(string $prefix): FieldTypeInterface
    {
        $this->prefix = $prefix;

        // Update all attached fields with the given prefix.
        foreach ($this->repository->all() as $field) {
            /** @var FieldTypeInterface $field */
            $field->setPrefix($prefix);
        }

        return $this;
    }
841744
public function addPrefix($prefix, $paths)
    {
        if (!$prefix) {
            foreach ((array) $paths as $path) {
                $this->fallbackDirs[] = $path;
            }

            return;
        }
        if (isset($this->prefixes[$prefix])) {
            $this->prefixes[$prefix] = array_merge(
                $this->prefixes[$prefix],
                (array) $paths
            );
        } else {
            $this->prefixes[$prefix] = (array) $paths;
        }
    }
389209
public function addNamePrefix(string $prefix)
    {
        $prefixedRoutes = [];

        foreach ($this->routes as $name => $route) {
            $prefixedRoutes[$prefix.$name] = $route;
            if (null !== $name = $route->getDefault('_canonical_route')) {
                $route->setDefault('_canonical_route', $prefix.$name);
            }
        }

        $this->routes = $prefixedRoutes;
    }
1302421
public function set_prefix( $prefix ) {
		if ( ! Str::starts_with( $prefix, '/' ) || Str::ends_with( $prefix, '/' ) ) {
			throw new MalformedRouteException;
		}

		$this->prefix = $prefix;

		return $this;
	}
620680
public static function lookupNamespace($prefix)
    {
        return isset(self::$_namespaces[$prefix]) ?
            self::$_namespaces[$prefix] :
            $prefix;
    }