PHP code example of zeixcom / craft-index-views

1. Go to this page and download the library: Download zeixcom/craft-index-views 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/ */

    

zeixcom / craft-index-views example snippets


use craft\events\RegisterComponentTypesEvent;
use yii\base\Event;
use zeixcom\craftindexviews\services\ViewsService;

Event::on(ViewsService::class, ViewsService::EVENT_REGISTER_ELEMENT_TYPES, function(RegisterComponentTypesEvent $event) {
    $event->types[] = Product::class;
});