I am building a web application which is divided in a frontend website and a backend website both build with Yii of course. I do this separation for making it easier to develop my .NET and Mobile Apps at the same time consuming the same services like the website.
The backend has no "site/index"-controller-action. For getting the data from the backend I have written appropriate controllers on the backend that provide the SOAP services.
Now my questions:
1. when i consume the backend soap services, should i write an own frontend-model class appropriate for every backend controller class or should i put the consuming directly into the frontend controllers?
2. Is there an easy way to map the functions of a model of the backend to a model in the frontend?
Page 1 of 1
Best Practises for separation of Frontend / Backend
#4
Posted 10 August 2012 - 08:47 AM
sorry I thought you just wanted to know what is best practice for back-end
ok here
1. you create a separate back-end to manage you data and entries.
2. sure you can use the same models just add them in your main config file
you should try and keep it dry one of the convention yii uses
ok here
1. you create a separate back-end to manage you data and entries.
2. sure you can use the same models just add them in your main config file
'import'=>array( 'application.models.*', 'application.components.*', 'application.modules.backend-module-name.models.*', ),
you should try and keep it dry one of the convention yii uses
#5
Posted 10 August 2012 - 08:56 AM
Quote
1. you create a separate back-end to manage you data and entries.
I already have created a backend (is on one server) and i have a frontend on another server.
Quote
2. sure you can use the same models just add them in your main config file
Re: I don't understand - how can i use a model in Yii that is on another server..?
My problem is that i would like to use the scaffolding features like the CRUD-generator for the data in the backend but available for the frontend. How can i get the Backend-Webservice into the ActiveRecord of the Model that the Gii requires for getting the data in order to build the edit forms?
#6
Posted 10 August 2012 - 09:05 AM
you cant use the models that are on a separate server you have to create the models
you can use same database and read the data and create the models according to your back-end schema
you can use same database and read the data and create the models according to your back-end schema
#7
Posted 15 November 2012 - 05:19 AM
alirz23, on 10 August 2012 - 09:05 AM, said:
you cant use the models that are on a separate server you have to create the models
you can use same database and read the data and create the models according to your back-end schema
you can use same database and read the data and create the models according to your back-end schema
That is what i was concerned about.. more work
Share this topic:
Page 1 of 1

Help












