【问题标题】:Yii Widget, unexpected ), where is the error?Yii Widget,出乎意料),错误在哪里?
【发布时间】:2013-04-23 03:04:33
【问题描述】:
<?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 解析错误:语法错误,第 14 行 /dev/shm/untitled.php 中的意外 ')'

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

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

【问题讨论】:

    标签: twitter-bootstrap yii widget


    【解决方案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
      );
    ?>
    

    【讨论】:

    • 嗯,当然,我不知道为什么我认为它在数组中
    • NetBeans IDE 7.2.1(内部版本 201210100934)
    【解决方案2】:

    见说明

    Requires
    
    php: >=5.4.0
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-04
      • 1970-01-01
      • 1970-01-01
      • 2014-09-11
      相关资源
      最近更新 更多