/** * Loads a helper file into memory. Supports namespaced helpers, * both in and out of the 'helpers' directory of a namespaced directory. * * @param string $filename * * @return string */ function helper(string $filename) { $loader = Services::locator(true); if (strpos($filename, '_helper') === false) { $filename .= '_helper'; } $path = $loader->locateFile($filename, 'Helpers'); if (!empty($path)) { include $path; } }