static function link($text, $url, $options = array())
{
if (isset($options['confirm'])) {
if (!empty($options['confirm'])) {
$confirmMessage = $options['confirm'];
$confirmAction = '';
if (isset($options['confirmaction'])) {
if (!empty($options['confirmaction'])) {
$confirmAction = $options['confirmaction'];
}
unset($options['confirmaction']);
}
$options['onclick'] = Html::getConfirmationOnActionScript($options['confirm'], $confirmAction);
}
unset($options['confirm']);
}
// Do not escape title if it is an image
if (!preg_match('/^<img.*/', $text)) {
$text = Html::cleanInputText($text);
}
return sprintf('<a href="%1$s" %2$s>%3$s</a>', Html::cleanInputText($url), Html::parseAttributes($options), $text);
}