2017 © Pedro Peláez
 

yii2-extension yii2-slider

Carousel 2.3.3

image

tomaivanovtomov/yii2-slider

Carousel 2.3.3

  • Monday, April 16, 2018
  • by Toma
  • Repository
  • 0 Watchers
  • 0 Stars
  • 26 Installations
  • HTML
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 15 Versions
  • 0 % Grown

The README.md

STILL IN DEVELOPMENT!!!!

yii2-slider

Yii2 slider is an extension with Owl Carousel 2.3.3 slider in it.
The slider has multilingual behaviour for title and description on each slide., (*1)

Installation

composer require tomaivanovtomov/yii2-revolution "^1.1.3"

Configuration

Add the Module class to config.php:, (*2)

'modules' => [
    ....
    'user' => [
        'class' => 'tomaivanovtomov\slider\Module',
    ],
    ....
],

Add migrations

Create the two tables - slide and slideLang, (*3)

php yii migrate/up --migrationPath=@vendor/tomaivanovtomov/yii2-slider/migrations

Register assets

Register revolution assets on top of your layout\main.php, (*4)

\tomaivanovtomov\revolution\Assets::register($this);

Image path is set to www.example.com/frontend/web ., (*5)

Usage

Call the widget and set the preferable options.
height - height of the slider.
slides - Images like an array of objects., (*6)


public static function getSliderImages() { return \tomaivanovtomov\slider\models\Slide::find() ->joinWith('translation') ->select(['slide.id', 'slideLang.title', 'slide.filename']) ->where('slideLang.language=:lang', [':lang' => Yii::$app->language]) ->all(); }
    echo \tomaivanovtomov\slider\widgets\Slider::widget([
        'slides' => \tomaivanovtomov\slider\models\Slide::getSliderImages(),
        'height' => 400,
        'options' => [
            'items' => 1
        ]
    ]);

All slider options can be seen at, (*7)

https://owlcarousel2.github.io/OwlCarousel2/docs/api-options.html

Multilingual part

Copy these line in params.php:, (*8)

'language-information' => [
    'BG' => [
        'title' => 'Български',
        'extension' => 'bg',
    ],
    'EN' => [
        'title' => 'English',
        'extension' => 'en',
    ],
],
'languageDefault' => 'bg'

This portion of code is linked with the multilingual model functionality. You can override the model and adapt it to your needs., (*9)

The Versions

16/04 2018
16/04 2018
13/04 2018
13/04 2018
13/04 2018
13/04 2018
13/04 2018
13/04 2018
13/04 2018
12/04 2018
12/04 2018
12/04 2018
11/04 2018

1.0.1

1.0.1.0

Carousel 2.3.3

  Sources   Download

MIT

The Requires

 

by Toma Tomov

10/04 2018

1.0.0

1.0.0.0

Revolution slider

  Sources   Download

MIT

The Requires

 

by Toma Tomov