ConnectViewHelper.php 665 Bytes
Newer Older
1
2
3
4
<?php

namespace UnicaenAuth\View\Helper;

Bertrand Gauthier's avatar
Bertrand Gauthier committed
5
6
7
use Laminas\Form\Form;
use Laminas\View\Helper\AbstractHelper;
use Laminas\View\Renderer\PhpRenderer;
8
9
10
11

/**
 * Aide de vue dessinant le formulaire correspondant au type d'authentification spécifié.
 *
12
 * @property PhpRenderer $view
13
14
15
16
17
 * @author Unicaen
 */
class ConnectViewHelper extends AbstractHelper
{
    /**
18
     * @param string $type 'local', 'shib', ldap', etc.
19
20
21
     * @param Form $form
     * @return AbstractConnectViewHelper
     */
22
    public function __invoke(string $type, Form $form): AbstractConnectViewHelper
23
    {
24
        return $this->view->plugin($type . 'Connect')($form); // ex: 'localConnect'
25
    }
26
}