|
@@ -86,7 +86,9 @@ class IconCollection {
|
|
|
* @return string
|
|
* @return string
|
|
|
*/
|
|
*/
|
|
|
public function render(string $icon, array $options = [], array $attributes = []): string {
|
|
public function render(string $icon, array $options = [], array $attributes = []): string {
|
|
|
|
|
+ $iconName = null;
|
|
|
if (isset($this->_config['map'][$icon])) {
|
|
if (isset($this->_config['map'][$icon])) {
|
|
|
|
|
+ $iconName = $icon;
|
|
|
$icon = $this->_config['map'][$icon];
|
|
$icon = $this->_config['map'][$icon];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -106,11 +108,11 @@ class IconCollection {
|
|
|
if (!isset($options['title']) || $options['title'] !== false) {
|
|
if (!isset($options['title']) || $options['title'] !== false) {
|
|
|
$titleField = !isset($options['title']) || $options['title'] === true ? 'title' : $options['title'];
|
|
$titleField = !isset($options['title']) || $options['title'] === true ? 'title' : $options['title'];
|
|
|
if (!isset($attributes[$titleField])) {
|
|
if (!isset($attributes[$titleField])) {
|
|
|
- $attributes[$titleField] = ucwords(Inflector::humanize(Inflector::underscore($icon)));
|
|
|
|
|
|
|
+ $attributes[$titleField] = ucwords(Inflector::humanize(Inflector::underscore($iconName ?? $icon)));
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!isset($options['translate']) || $options['translate'] !== false && isset($attributes[$titleField])) {
|
|
|
|
|
+ $attributes[$titleField] = __($attributes[$titleField]);
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
- if (!isset($options['translate']) || $options['translate'] !== false) {
|
|
|
|
|
- $attributes['title'] = __($attributes['title']);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return $this->iconSets[$set]->render($icon, $options, $attributes);
|
|
return $this->iconSets[$set]->render($icon, $options, $attributes);
|