ynh_extension_meeo/actions/ElevesAction.php
2024-07-17 17:23:33 +02:00

28 lines
No EOL
738 B
PHP

<?php
use YesWiki\Core\YesWikiAction;
use YesWiki\Bazar\Service\EntryManager;
use YesWiki\Bazar\Service\ListManager;
class ElevesAction extends YesWikiAction
{
public function formatArguments($arg)
{
return [];
}
public function run()
{
$meeo_config = $this->params->get('meeo');
$formId = $meeo_config['elevesFormId'];
$entryManager = $this->getService(EntryManager::class);
$eleves = $entryManager->search(['formsIds' => $formId]);
// echo '<p>'.var_dump($eleves).'</p>';
$listManager = $this->getService(ListManager::class);
$classes = $listManager->getOne('ListeClasses');
return $this->render('@meeo/edu_eleves.twig', ['eleves' => $eleves, 'classes' => $classes['label']]);
}
}