DmitryDulepov\Realurl\Encoder\UrlEncoder::encodePostVarSets PHP Method

encodePostVarSets() protected method

Encodes 'postVarSets' into URL segments.
protected encodePostVarSets ( ) : void
return void
    protected function encodePostVarSets()
    {
        // There is at least an 'id' parameter
        if (count($this->urlParameters) > 1) {
            $configuration = (array) $this->configuration->get('postVarSets');
            $postVarSetConfigurations = $this->getConfigurationForPostVars($configuration, $this->urlParameters['id']);
            foreach ($postVarSetConfigurations as $postVar => $postVarSetConfiguration) {
                if (is_array($postVarSetConfiguration)) {
                    // Technically it can be a string (for decoding purposes) but makes no sense for encoding
                    // And decoder does not support it too (see UrlDecoder::decodePostVarSets)
                    $segments = $this->encodeUrlParameterBlock($postVarSetConfiguration);
                    if (count($segments) > 0) {
                        array_unshift($segments, $postVar);
                        $this->appendToEncodedUrl(implode('/', $segments));
                    }
                }
            }
        }
    }