ok to display entries and equipments in templates

This commit is contained in:
JBthePenguin 2021-06-05 13:52:32 +02:00
parent c74ba5ed85
commit c3eb06ce0d
6 changed files with 50 additions and 2 deletions

View file

@ -2,6 +2,20 @@
namespace Garradin;
use Garradin\Plugin\Materiels\Equipment;
use Garradin\Plugin\Materiels\Entry;
require_once __DIR__ . '/../../_inc.php';
$eqmt = new Equipment;
$entry = new Entry;
$entries = $entry->listAll();
foreach ($entries as $key => $value) {
$entries[$key]->equipment = $eqmt->get($value->equipment_id);
}
$tpl->assign(compact('entries'));
$tpl->display(PLUGIN_ROOT . '/templates/entrees/definitives/index.tpl');