Yii Framework Forum: Creating a REST API for Yii2-basic-template - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Creating a REST API for Yii2-basic-template

#1 User is offline   folumike 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 169
  • Joined: 27-November 14

Posted 28 February 2018 - 11:48 AM

I am trying to create a Rest API (BACKEND) for Yii2 basic template, to be used by AngularJS (FRONTEND).
I tried to use the Directory Structure below, but got lost.

myapp
+ web
+ config
+ controllers
+ models
+ views
+ vendors
...
+ api
--+ config
--+ modules
----+ v1
------+ controllers
--.htaccess
--index.php

Please can you give a sample Directory Structure of the API, and the contents
0

#2 User is offline   Stefano Mtangoo 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 379
  • Joined: 02-January 12
  • Location:Dar es Salaam, Tanzania

Posted 01 March 2018 - 02:17 AM

Should it be REST only? In that case go for Microframework. Check it, its in the guide. It gives you flexibility you seem to need.

If its part of bigger Yii app then I suggest you make it a nested module, that is:

app/modules/api/v1

HTH
And God said, Let there be science...and it was so! Kwa kazi za Mifumo ya Computer tuone tukusaidie hapa!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users