Troubles adding a new page to a sprinkle

I’m trying to follow the recipe 1 on adding a page to the Site sprinkle, I made everything like it’s written there, also the steps from first chapters but I’m still getting this error :

image

then just to see what’s wrong, I tried to modify a route already there in the core sprinkle like this :

$app->get(’/legal’, ‘UserFrosting\Sprinkle\Core\Controller\CoreController:pageMembers’);

and that works without any problem, can anyone make this more clear to me.

Thank in advance.

Anwar

Thank you

Sorry about that! For some reason, I haven’t been getting email notifications of new forum posts. Keep in mind that you can always join us in chat, which tends to be much more active.

The error you’re getting suggests that Slim is trying to invoke your controller class in a static context (which it shouldn’t be). Can you please post your original route definition? Maybe you are mistakenly using the :: operator (which is a static operator) instead of : (which Slim recognizes as an instruction to create a new instance of the controller class).

I wondered why no one answered this but with no notifications it makes sense now.

Yes Alex that’s exactly what I was doing wrong, I was using the :: instead of : in the route

$app->get(’/members’, ‘UserFrosting\Sprinkle\Site\Controller\PageController::pageMembers’);

Thank you very much for this.