Cake\Routing\Route\Route::_persistParams PHP Method

_persistParams() protected method

Apply persistent parameters to a URL array. Persistent parameters are a special key used during route creation to force route parameters to persist when omitted from a URL array.
protected _persistParams ( array $url, array $params ) : array
$url array The array to apply persistent parameters to.
$params array An array of persistent values to replace persistent ones.
return array An array with persistent parameters applied.
    protected function _persistParams(array $url, array $params)
    {
        foreach ($this->options['persist'] as $persistKey) {
            if (array_key_exists($persistKey, $params) && !isset($url[$persistKey])) {
                $url[$persistKey] = $params[$persistKey];
            }
        }
        return $url;
    }