Yii Framework Forum: Yii2 and Angular JS - Yii Framework Forum

Jump to content

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

Yii2 and Angular JS

#1 User is offline   folumike 

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

Posted 11 February 2018 - 12:45 AM

I want to develop an application that has admin, web and mobile section. How do I integrate AngularJS and REST API into Yii2 to achieve this.
I have 3 interfaces:

1. Backend (admin - setup) => http://localhost/lms/admin/index.php

Attached File  admin.PNG (1.2K)
Number of downloads: 3

2. Frontend (Teacher - module) => http://localhost/lms/index.php

Attached File  teacher.PNG (1.05K)
Number of downloads: 3

3. Student module => This is the student interface. I want it to be for mobile app using yii2 and angularJS.

Attached File  yii2.PNG (6.34K)
Number of downloads: 2

Since I've used backend for admin, and frontend for teacher, How do I go about the student interface.

Or is there a better way to do it.

Thanks
0

#2 User is offline   jim. 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 182
  • Joined: 28-June 12
  • Location:Germany

Posted 16 February 2018 - 05:16 AM

Example how to set up an api in app-advanced: http://budiirawan.co...stful-api-yii2/

Another example (not an app-advanced): https://github.com/s...ter/modules/api

AngularJS & Yii2: http://blog.neattuto...part-1-routing/
0

#3 User is offline   itma 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 133
  • Joined: 16-September 13

Posted 21 February 2018 - 04:48 AM

View Postjim., on 16 February 2018 - 05:16 AM, said:



Hey,

Let me put my 2c. I would really avoid the way to integrate views, js and the API in one place. I would do that like this:

- establish an API which the frontend will connect to (eg. api.yourdomain.com)
- put the html & js files out of the API, even an another domain (eg. mobile.yourservice.com, admin.yourservice.com, yourservice.com)

It will give you the freedom at the point where you want to replace the frontend or backend (api).
I've been using the approach in my projects like http://mikrokiosk.pl (only in polish but take a look at the widget presenting products - it is done exactly that way).

Cheers!
A full stack developer for hire (andrew@itma.pl)
https://twitter.com/Andrew_Bernat
0

#4 User is offline   Stefano Mtangoo 

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

Posted 01 March 2018 - 02:20 AM

I suggest you make student a nested module to allow versioning

app/modules/students/v1
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