original_string: 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);
      }
code: 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);
      }
code_tokens: 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 ) ; }
docstring: 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.
docstring_tokens: Replace placeholders with links .