PHP code example of carlcs / craft-elementstats

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

    

carlcs / craft-elementstats example snippets


return [
    'stats' => [
        'all-entries' => [
            'name'        => 'All Entries',
            'link'        => 'entries',
            'elementType' => 'Entry',
        ],
        'sports-news' => [
            'name'        => 'Sports News',
            'link'        => 'entries/news',
            'elementType' => 'Entry',
            'criteria'    => [
                'section' => 'news',
                'type'    => 'sports',
            ],
        ],
    ],
];