private function key($content) { import('ORG.Util.KeyReplace'); $key = M('key'); $keys = $key->field('url,title,num')->select(); $map = array(); foreach ($keys as $k => $v) { $map[$k]['Key'] = $v['title']; $map[$k]['Href'] = "<a href=\"{$v['url']}\" target=\"_blank\">{$v['title']}</a>"; $map[$k]['ReplaceNumber'] = $v['num']; } $a = new KeyReplace($map, $content); $a->KeyOrderBy(); $a->Replaces(); return $a->HtmlString; }