PHP code example of peet86 / craft-reports
1. Go to this page and download the library: Download peet86/craft-reports 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/ */
peet86 / craft-reports example snippets
twig
public function registerReports()
{
$types = [];
$folders = IOHelper::getFolders(craft()->path->getPluginsPath().'tester/templates/reports/');
foreach($folders as $folder){
$name = IOHelper::getFolderName($folder, false);
$types[$name] = 'reports/'.$name;
}
return $types;
}