PHP code example of fluffy-factory / user-stats-bundle

1. Go to this page and download the library: Download fluffy-factory/user-stats-bundle 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/ */

    

fluffy-factory / user-stats-bundle example snippets


class User
{
    ### ADD THIS ###
    use UserStats;

    ...
}

$userStats = Action::new('userStats', 'Statistiques utilisateur')
    ->linkToRoute('fluffy_user_stats', function (User $entity) {
       return [
           'id' => $entity->getId()
       ];
    });

return parent::configureActions($actions)
    ->add(Crud::PAGE_INDEX, $userStats)
        ->setPermission('userStats', 'ROLE_SUPER_ADMIN');

php bin/console assets:install
yaml
fluffy_user_stats:
  resource: "@UserStatsBundle/Controller/UserStatsController.php"
  type: annotation
  # prefix: /admin