我剛開始在yii中劃傷表面,並且有一段時間讓圖像滑塊擴展工作。我引用了http://www.yiiframework.com/doc/guide/1.1/en/extension.use,並認爲我的問題與擴展的初始化有關,但我不確定。我試圖使用的最近的擴展是http://www.yiiframework.com/extension/s3slider/。yii擴展幫助
到目前爲止,我已經下載了擴展,解壓縮並放置在/ protected/extensions。我嘗試在位於/圖像之間滑動的兩張圖像。我已經放在建議的代碼在我/protected/views/layouts/main.php並更新了$圖像陣列如下:
<?php
$this->widget('application.extensions.s3slider.S3Slider',
array(
'images' => array(
array('images/giveBack.png', 'Give Back'),
array('images/priceGuarantee.png', 'Price Guarantee'),
),
'width' => '420',
'height' => '300',
)
);?>
當我刷新我的網頁,我得到以下錯誤:
PHP notice
Array to string conversion
/protected/extensions/s3slider/S3Slider.php(71)
59 $cssparams = array(
60 'name' => $this->name,
61 'width' => $this->width,
62 'height' => $this->height,
63 'opacity' => $this->opacity,
64 );
65 $clientScript->registerCssFile($baseUrl . '/s3Slider.css.php?data=' . urlencode(base64_encode(serialize($cssparams)))); //http_build_query($cssparams)
66
67 $clientScript->registerCoreScript('jquery');
68
69 $clientScript->registerScriptFile($baseUrl . '/s3Slider.js');
70
71 $js = "jQuery('#{$this->name}').s3Slider($options);";
72 $cs->registerScript('Yii.S3Slider' . $this->name, $js);
73 echo $this->makeImages();
74 }
75
76 }
77 ?>
我的堆棧跟蹤表明:
/protected/views/layouts/main.php(60): CBaseController->widget("application.extensions.s3slider.S3Slider", array("images" => array(array("images/giveBack.png", "Give Back"), array("images/priceGuarantee.png", "Price Guarantee")), "width" => "420", "height" => "300"))
55 array('images/priceGuarantee.png', 'Price Guarantee'),
56 ),
57 'width' => '420',
58 'height' => '300',
59 )
60 );?>
61
62 <?php
63 $this->widget('zii.widgets.CBreadcrumbs', array(
64 'links'=>$this->breadcrumbs,
65 )); ?><!-- breadcrumbs -->
對此有何指導,將不勝感激!
謝謝。
只需關掉注意錯誤,否則您的第三方軟件將會一直出現這種錯誤。 – ole