Contao\Module::findClass PHP Method

findClass() public static method

Find a front end module in the FE_MOD array and return the class name
public static findClass ( string $strName ) : string
$strName string The front end module name
return string The class name
    public static function findClass($strName)
    {
        foreach ($GLOBALS['FE_MOD'] as $v) {
            foreach ($v as $kk => $vv) {
                if ($kk == $strName) {
                    return $vv;
                }
            }
        }
        return '';
    }

Usage Example

Esempio n. 1
0
 /**
  * Find a front end module in the FE_MOD array and return the class name
  *
  * @param string $strName The front end module name
  *
  * @return string The class name
  *
  * @deprecated Deprecated since Contao 4.0, to be removed in Contao 5.0.
  *             Use Module::findClass() instead.
  */
 public static function findFrontendModule($strName)
 {
     trigger_error('Using Controller::findFrontendModule() has been deprecated and will no longer work in Contao 5.0. Use Module::findClass() instead.', E_USER_DEPRECATED);
     return \Module::findClass($strName);
 }