PHP code example of philippfrenzel / yii2masonry

1. Go to this page and download the library: Download philippfrenzel/yii2masonry library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

philippfrenzel / yii2masonry example snippets



 \yii2masonry\yii2masonry::begin([
    'clientOptions' => [
        'columnWidth' => 50,
        'itemSelector' => '.item'
    ]
]); 


$script = <<< JS
    $('a#menu_toggle').on('click', function() {
        $('.js-masonry').masonry();
    });
JS;
$this->registerJs($script, View::POS_READY);

use yii\helpers\Html;
use yii\widgets\ListView;
use yii\web\JsExpression;
use yii\widgets\Pjax;

/* @var $this yii\web\View */
/* @var $searchModel app\models\PolizzenserviceSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$script = <<<SKRIPT
$('#boxes').on('infinitescroll:afterRetrieve', function(){
    msnryWgArbeiten.masonry('reloadItems');
    mscontainerWgArbeiten.imagesLoaded(function(){ msnryWgArbeiten.masonry() });
});

$(document).on('submit', '#WgArbeitenSearchform', function(event) {
  $.pjax.submit(event, '#WgArbeitenPjaxContainer')
});
SKRIPT;
$this->registerJs($script);