문제

I want to create a simple api using Fat free framework but I am confused where should I put my code. Should I put my code in index.php which can also handling routing for the rest of the files. Can somebody help me about this issue. can you please draw a folder structure for me it would be a great favor for me. I want to return the response in json format like this:

{ "artists":
[{
"id": 1,
  "name": "Chavvy Chavface",
  "soundcloud_user_id": 12345,
  "track": {
    "title": "Super Music"
    "soundcloud_track_id": 12345,
  },
  "zipcode": "60613"
}]
}
도움이 되었습니까?

해결책

You're absolutely free to use any folder structure you like. You can put the whole code in your index.php, which the more your project grows, the more yourfile will becomes unreadable and confusing.

There's also an official CMS demo: https://github.com/bcosca/fatfree/blob/archive/f3-3.0.6.cms.demo.zip

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top