protected function _linkUrls($text, $htmlOptions)
    {
        $replace = [];
        foreach ($this->_placeholders as $hash => $content) {
            $link = $url = $content['content'];
            $envelope = $content['envelope'];
            if (!preg_match('#^[a-z]+\://#i', $url)) {
                $url = 'http://' . $url;
            }
            $replace[$hash] = $envelope[0] . $this->Html->link($link, $url, $htmlOptions) . $envelope[1];
        }

        return strtr($text, $replace);
    }
protected function _linkUrls($text, $htmlOptions)
    {
        $replace = [];
        foreach ($this->_placeholders as $hash => $content) {
            $link = $url = $content['content'];
            $envelope = $content['envelope'];
            if (!preg_match('#^[a-z]+\://#i', $url)) {
                $url = 'http://' . $url;
            }
            $replace[$hash] = $envelope[0] . $this->Html->link($link, $url, $htmlOptions) . $envelope[1];
        }

        return strtr($text, $replace);
    }
protected function _linkUrls ( $ text , $ htmlOptions ) { $ replace = [ ] ; foreach ( $ this -> _placeholders as $ hash => $ content ) { $ link = $ url = $ content [ 'content' ] ; $ envelope = $ content [ 'envelope' ] ; if ( ! preg_match ( '#^[a-z]+\://#i' , $ url ) ) { $ url = 'http://' . $ url ; } $ replace [ $ hash ] = $ envelope [ 0 ] . $ this -> Html -> link ( $ link , $ url , $ htmlOptions ) . $ envelope [ 1 ] ; } return strtr ( $ text , $ replace ) ; }
Replace placeholders with links.

@param string $text The text to operate on.
@param array $htmlOptions The options for the generated links.
@return string The text with links inserted.
Replace placeholders with links .