brygiger
brygiger

Reputation: 88

Separating angular frontend for views from Yii backend Controller and Model

I'm trying to implement an angular frontend and a yii backend such that angular will handle all the routing and views whereas yii will just handle the controllers/model and database connection. Angular can send ajax requests for data which will be handled by the RESTfullYii extension. I've already implemented this through inserting angular code in the yii view files.

What I want though is both of them to be completely separate interacting only through the REST extension.

I'm trying to copy the structure in this app where the frontend is in a separate folder from yii's protected folder, but I don't know how to set the routing such that it will automatically render the index.html file from the angular-yii folder.

http://www.yiiframework.com/wiki/497/angularjs-frontend-connecting-it-with-a-yii-backend-rest-api-gallery-manager-demo-application/

Upvotes: 1

Views: 1152

Answers (1)

brygiger
brygiger

Reputation: 88

Figured it out

Apparently just had to point the url to my angular files then then set the .htaccess rewrite engine on to make sure yii does not handle it.

Upvotes: 1

Related Questions