Yii Widget, неожиданно) где ошибка?

<?php 
  $this->widget('bootstrap.widgets.TbAlert', array(
      'block'=>true, // display a larger alert block?
      'fade'=>true, // use transitions?
      'closeText'=>'&times;', // close link text - if set to false, no close link is displayed
      'alerts'=>array( // configurations per alert type
        'success'=>array(
          'block'=>true,
          'fade'=>true,
          'closeText'=>'&times;',
        ), // success, info, warning, error or danger
      ),
    ),
  );
?>

Ошибка синтаксического анализа PHP: синтаксическая ошибка, неожиданная ')' в /dev/shm/untitled.php в строке 14

Я действительно не могу найти ошибку и смотрел ее как 100 раз. Нужно реализовать этот виджет, спасибо!

Есть 4 открывающие скобки и 4 закрывающие. Запятые в порядке, так что...?

2 ответа

Решение
<?php 
  $this->widget('bootstrap.widgets.TbAlert', array(
      'block'=>true,
      'fade'=>true,
      'closeText'=>'&times;',
      'alerts'=>array( 
        'success'=>array(
          'block'=>true,
          'fade'=>true,
          'closeText'=>'&times;'
        ),
      ),
    ), // you have comma here - it's mistake
  );
?>

Смотри инструкцию

Requires

php: >=5.4.0
Другие вопросы по тегам