0

I'm learning Concrete5 and ran into something that has stumped me, but seems like it should be simple to fix.

My class (which resides at \application\src\Derp\Derp.php):

namespace Application\Src\Derp;    
use Concrete\Core\Database\Connection\Connection;

class Derp
{   
    return 'Hello';
}

I'm calling it from a page in my theme, like so:

use Application\Src\Derp;
$derp = new Derp();
var_dump($derp);

I keep getting 'An Unexpected Error Occurred'. Class 'Application\Src\Derp\Derp' not found. What have I missed?

1 Answers1

1

You should reference the path all the way to the class. So try

use Application\Src\Derp\Derp;
Nicolai Krüger
  • 416
  • 4
  • 17