0
<?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 Parse 错误:语法错误,第 14 行 /dev/shm/untitled.php 中的意外 ')'

我真的找不到错误,看了 100 遍。需要实现这个小部件,谢谢!

有 4 个左括号和 4 个右括号。逗号没问题,所以...?

4

2 回答 2

1
<?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
  );
?>
于 2013-04-29T12:42:05.343 回答
0

见说明

Requires

php: >=5.4.0
于 2015-03-03T13:30:15.797 回答