1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Not a Bug Can't use namespace on ControllerHelper

Discussion in 'Resolved Bug Reports' started by Nobita.Kun, Jul 26, 2014.

  1. Nobita.Kun

    Nobita.Kun 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
    Liam W likes this.
  2. Liam W

    Liam W Well-Known Member

    Nobita.Kun likes this.
  3. Mike

    Mike XenForo Developer Staff Member

    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.

Share This Page