Add URL::to_language and HTML::link_to_language localization helpers
Signed-off-by: Anahkiasen <ehtnam6@gmail.com>
This commit is contained in:
@@ -238,6 +238,19 @@ class HTML {
|
||||
return static::link(URL::to_action($action, $parameters), $title, $attributes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate an HTML link to a different language
|
||||
*
|
||||
* @param string $language
|
||||
* @param string $title
|
||||
* @param array $attributes
|
||||
* @return string
|
||||
*/
|
||||
public static function link_to_language($language, $title = null, $attributes = array())
|
||||
{
|
||||
return static::link(URL::to_language($language), $title, $attributes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate an HTML mailto link.
|
||||
*
|
||||
@@ -347,7 +360,7 @@ class HTML {
|
||||
|
||||
return '<'.$type.static::attributes($attributes).'>'.$html.'</'.$type.'>';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generate a definition list.
|
||||
*
|
||||
@@ -360,13 +373,13 @@ class HTML {
|
||||
$html = '';
|
||||
|
||||
if (count($list) == 0) return $html;
|
||||
|
||||
|
||||
foreach ($list as $term => $description)
|
||||
{
|
||||
$html .= '<dt>'.static::entities($term).'</dt>';
|
||||
$html .= '<dd>'.static::entities($description).'</dd>';
|
||||
}
|
||||
|
||||
|
||||
return '<dl'.static::attributes($attributes).'>'.$html.'</dl>';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user