$path) { $field['url'] = str_replace('{{' . $k . '}}', $this->Hash->extract($data, $path)[0], $field['url']); } } if (substr($field['url'], 0, 4) === 'http') { $baseurl = ''; } $string = sprintf( '%s', $baseurl, h($field['url']), h($string) ); } else if (empty($field['raw'])) { $string = h($string); } echo $string;