Not a bug Can't use namespace on ControllerHelper


Well-known member
If you have an ControllerHelper using namespace so you can't call its on ControllerPublic. Because this line:
if (strpos($class, '_') === false)
            $class = 'XenForo_ControllerHelper_' . $class;
Your class into that :eek:
Hope that's useful to detect :):)

And error:
Fatal error: Class name must be a valid object or a string in E:\xampp\htdocs\dev\library\XenForo\Controller.php on line 1078
No real plans to change this as the system is not designed with namespaces in mind; you may find this pattern in a few places.

The function is mostly for the core system as well, to ensure that classes can be extended. If you're calling your own code, you can just create the object directly if desired.
Top Bottom