yii2sly ¶
This extension is a wrapper for the amazing jquery slider "sly" which can be found here:
Pls. take a closer look at all the plugin options, which can be passed over by adding them to the "clientOptions" parameter as shown below.
A demo of the extension can be found here:
http://yii2fullcalendar.beeye.org/index.php/site/sly
Installation ¶
Add this to your composer.json require section
"philippfrenzel/yii2sly": "*",
And finaly the view should look like this:
<?php
use yii\helpers\Url;
?>
<h1><?php echo Html::encode($this->title); ?></h1>
<?= philippfrenzel\yii2sly\yii2sly::widget([
'id' => 'sp_slider',
'items'=> [
['content' => '<img src="' . Url::to('@web/img/sportster_forty-eight_sly.jpg') . '"></img>'],
['content' => '<img src="' . Url::to('@web/img/softtail_heritage-classic_sly.jpg') . '"></img>'],
['content' => '<img src="' . Url::to('@web/img/dyna_wide-glide_sly.jpg') . '"></img>'],
['content' => '<img src="' . Url::to('@web/img/cvo_limited_sly.jpg') . '"></img>'],
['content' => '<img src="' . Url::to('@web/img/v-rod_muscle_sly.jpg') . '"></img>']
],
'options' => [
'style' => "height:400px;"
],
'clientOptions' => [
'horizontal' => 1,
'activateMiddle' => 1,
...
]
]); ?>
Currently it cause issues with having multiple sly's on one page, but we know this issue and are working on it.
I get an error
I did what you said but I get this error:
PHP Fatal Error – yii\base\ErrorException
Class 'philippfrenzel\yii2sly\yii2sly' not found
Did you run the composer update
Hi,
after you've added the composer.json part, did you run on the command line:
php composer.phar update
? Otherwise you can see the full working code sample here:
https://github.com/philippfrenzel/yii2fullcalendar-demo
the yii2sly widhet is used under:
views/site/sly.php
Regards Phil
I get error on update the composer
ok, I've run the "composer update" but I get this error:
Your requirements could not be resolved to an installable set of packages.
Problem 1
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.