eluhr/yii2-baguette-box

There is no license information available for the latest version (1.0.0) of this package.

Yii2 Wrapper for feimosi/baguetteBox.js

Maintainers

👁 eluhr

Package info

github.com/eluhr/yii2-baguette-box

pkg:composer/eluhr/yii2-baguette-box

Statistics

Installs: 9 730

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2022-01-20 12:16 UTC

Requires

  • bower-asset/baguettebox.js: ^1.11

Requires (Dev)

None

Suggests

None

Provides

None

Conflicts

None

Replaces

None

Unknown License 055950b595b2f99eba06aedd97c85bee76e0b2da

  • Elias Luhr <elias.luhr.woop@gmail.com>

This package is auto-updated.

Last update: 2026-06-20 22:04:35 UTC


README

Yii2 Wrapper for feimosi/baguetteBox.js

Install

composer require eluhr/yii2-baguette-box

Usage

PHP

<?php
use eluhr\baguettebox\widgets\BaguetteBox;

echo BaguetteBox::widget([
 'items' => [
 [
 '/path/to/image-0.jpg',
 'link-options' => [
 'data-caption' => 'My caption 0'
 ]
 ],
 [
 '/path/to/image-1.jpg',
 'link-options' => [
 'data-caption' => 'My caption 1'
 ]
 ],
 '/path/to/image-2.jpg',
 [
 '/path/to/image-3.jpg',
 'link-options' => [
 'data-caption' => 'My caption 2'
 ],
 'image-options' => [
 'class' => 'my-class'
 ]
 ],
 '/path/to/image-4.jpg',
 [
 '/path/to/image-6.jpg',
 'thumbnail' => '/path/to/image-6-thumbnail.jpg'
 ]
 ],
 'items_per_row' => 4,
 'plugin_options' => [
 'noScrollbars' => true
 ],
 'options' => [
 'class' => 'gallery',
 ],
 'responsive' => [
 991 => 2,
 768 => 1 
 ]
]);
?>

TWIG

{{ use ('eluhr/baguettebox/widgets/BaguetteBox') }}

{{ BaguetteBox_widget({
 'items' : {
 {
 '/path/to/image-0.jpg',
 'link-options' : {
 'data-caption' : 'My caption 0'
 }
 },
 {
 '/path/to/image-1.jpg',
 'link-options' : {
 'data-caption' : 'My caption 1'
 }
 },
 {
 '/path/to/image-3.jpg',
 'link-options' : {
 'data-caption' : 'My caption 2'
 }
 },
 {
 '/path/to/image-6.jpg',
 'thumbnail' : '/path/to/image-6-thumbnail.jpg'
 }
 },
 'items_per_row' : 4,
 'plugin_options' : {
 'noScrollbars' : true
 },
 'options' : {
 'class' : 'gallery',
 },
 'responsive' : {
 991 : 2,
 768 : 1
 }
}) }}