selector = $selector; $this->cond = $cond; } /** * @var string sélecteur pour les composants concernés. */ private $selector; /** @var bool ce plugin est-il activé? */ private $cond; function printJquery(): void { if (!$this->cond) return; ?> $(selector)?>).change(function() { $(this).closest("form").submit(); return false; });