CampURI::render PHP Method

render() protected method

Builds a URI string from the given parts.
protected render ( array $p_parts = [] ) : string
$p_parts array The array of URI parts
return string $uriString The rendered URI
    protected function render(array $p_parts = array())
    {
        if (empty($p_parts)) {
            $p_parts = $this->m_parts;
        }
        if (!$this->isValidCache()) {
            $this->m_path = $this->getURIPath();
            $this->m_query = $this->getQuery();
        }
        $uriString = '';
        foreach ($p_parts as $part) {
            $property = 'm_' . $part;
            if (!empty($this->{$property})) {
                $uriString .= $part == 'scheme' ? $this->{$property} . '://' : '';
                $uriString .= $part == 'user' ? $this->{$property} : '';
                $uriString .= $part == 'password' ? ':' . $this->{$property} . '@' : '';
                $uriString .= $part == 'host' ? $this->{$property} : '';
                $uriString .= $part == 'port' ? ':' . $this->{$property} : '';
                $uriString .= $part == 'path' ? $this->{$property} : '';
                $uriString .= $part == 'query' ? '?' . $this->{$property} : '';
                $uriString .= $part == 'fragment' ? '#' . $this->{$property} : '';
            }
        }
        return $uriString;
    }