. */ /* */ /*************************************************************************************/ require_once __DIR__ . "/../../fonctions/autoload.php"; class FiltreFonction extends FiltreBase { public function __construct($nom_filtre) { switch($nom_filtre) { case 'min' : $this->fonction = 'strtolower'; break; case 'maj' : $this->fonction = 'strtoupper'; break; case 'sanstags' : $this->fonction = 'strip_tags'; break; } parent::__construct("`\#FILTRE_$nom_filtre\(([^\)]+)\)`"); } public function calcule($match) { $func = $this->fonction; return $func($match[1]); } } ?>