public static icon ( string $icon, array $options = [], string $prefix = 'glyphicon glyphicon-', string $tag = 'span' ) : string | ||
$icon | string | the bootstrap icon name without prefix (e.g. 'plus', 'pencil', 'trash') |
$options | array | HTML attributes / options for the icon container |
$prefix | string | the css class prefix - defaults to 'glyphicon glyphicon-' |
$tag | string | the icon container tag (usually 'span' or 'i') - defaults to 'span' |
return | string |
public static function icon($icon, $options = [], $prefix = 'glyphicon glyphicon-', $tag = 'span')
{
$class = isset($options['class']) ? ' ' . $options['class'] : '';
$options['class'] = $prefix . $icon . $class;
return static::tag($tag, '', $options);
}
public function run() { $months = [0 => 'Январь', 1 => 'Февраль', 2 => 'Март', 3 => 'Апрель', 4 => 'Май', 5 => 'Июнь', 6 => 'Июль', 7 => 'Август', 8 => 'Сентябрь', 9 => 'Октябрь', 10 => 'Ноябрь', 11 => 'Декабрь']; $time = time(); $request = \Yii::$app->request; $time = $request->get('time', $time); $month = date('n', $time); $year = date('Y', $time); echo '<div class="b-calendar b-calendar--along">'; echo '<h4 class="text-center">'; echo Html::a(Html::icon('triangle-left'), '?time=' . strtotime('-1 month', $time), ['class' => 'pull-left']); echo $months[$month - 1] . ' ' . $year; echo Html::a(Html::icon('triangle-right'), '?time=' . strtotime('+1 month', $time), ['class' => 'pull-right']); echo '</h4>'; echo $this->draw_calendar($month, 2016); echo '</div>'; }