public function filter(string $name, $func = null) : self { if (empty($func)) { $func = '\\Airship\\LensFunctions\\' . $name; } $this->twigEnv->addFilter(new \Twig_SimpleFilter($name, $func)); return $this; }
/** * Add a filter to the lens * * @param string $name * @param callable $func */ protected function addLensFilter(string $name, callable $func) { $this->airship_lens_object->filter($name, $func); }