Skip to content
Snippets Groups Projects
Commit 8607c4dc authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Parametrage

parent 40774100
No related branches found
No related tags found
No related merge requests found
Pipeline #17336 passed
......@@ -11,6 +11,14 @@ use UnicaenIndicateur\Service\Indicateur\IndicateurServiceAwareTrait;
class IndicateurViewHelper extends AbstractHelper {
use IndicateurServiceAwareTrait;
/**
* @param Indicateur $indicateur
* @param array $options
* @return \Laminas\View\Helper\Partial|string
*
* La clef $options['ViewHelper'] permet d'indiquer le ViewHelperpour réaliser l'affichage
* attention celui-ci doit implementer l'interface ItemViewHelperInterface
*/
public function __invoke(Indicateur $indicateur, array $options = [])
{
/** @var PhpRenderer $view */
......
......@@ -9,6 +9,9 @@ use UnicaenIndicateur\Entity\Db\Indicateur;
* @var array $options
*/
$viewhelper = 'defaultItem';
if (isset($options['ViewHelper'])) $viewhelper = $options['ViewHelper']
?>
<div>
......@@ -16,12 +19,12 @@ use UnicaenIndicateur\Entity\Db\Indicateur;
id="indicateur_<?php echo $indicateur->getId(); ?>"
class="datatable table table-condensed table-hover"
>
<?php echo $this->defaultItem($indicateur)->getHeader($data); ?>
<?php echo $this->{$viewhelper}($indicateur)->getHeader($data); ?>
<tbody>
<?php $nbLine = count($data[1]); ?>
<?php
for($position = 0 ; $position < count($data[1]) ; $position++) {
echo $this->defaultItem($indicateur)->getItem($data, $position);
echo $this->{$viewhelper}($indicateur)->getItem($data, $position);
}
?>
</tbody>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment