phprestfat-free-framework

Fat-Free with Cortex Models and REST


I'm trying to use FatFree and Cortex plugin within my REST API. I seem to have some challenges, at first I was challenged with the namespaces, which I was trying to find how to solve that. And then once I set that up, it was giving issues with method get() already existed. I later tried to not use namespaces to see if that would help, but continued with errors.

I am hoping to get some clarification on how to setup Cortex + F3 + REST API and having auto mapping routes. What am I doing wrong on setting up the model for Cortex? Namespaces doesn't really matter, if I use them or not (personally). Just would like it to work.

My Autoloader is

$f3->set('AUTOLOAD','app/controllers/;app/models/');

Here is my file setup enter image description here


Solution

  • Multiple issues here.

    I would suggest: