Hi I want to create a trait outside of the file where I am using it.
this is my trait in /application/Controllers/infoOne.php
<?php
namespace Application\Controller;
use Page;
use User;
use UserInfo;
defined('C5_EXECUTE') or die(_("Access Denied."));
trait InfoOne {
public function sdk () {
return 'foobar';
}
}
and this is my class where i want to use the trait
\Application\Controllers\SinglePage\manager.php
<?php
namespace Application\Controller\SinglePage;
use Concrete\Core\Page\Controller\PageController;
use Page;
use User;
use UserInfo;
use Application\Controller\InfoOne;
defined('C5_EXECUTE') or die(_("Access Denied."));
class Manager extends PageController {
use InfoOne;
}
but if I execute it, I get an error-message:
-Trait ‘Application\Controller\InfoOne’ not found
it seems like it has something to do with the autoloader but I cant figure out the problem.
Thanks for your help