Best Practises for separation of Frontend / Backend
Posted 10 August 2012 - 08:16 AM
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?
Posted 10 August 2012 - 08:47 AM
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
Posted 10 August 2012 - 08:56 AM
I already have created a backend (is on one server) and i have a frontend on another server.
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?
Posted 15 November 2012 - 05:19 AM
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 .. Maybe it would be a good feature for the Gii tool. Building frontend and backend controllers for interacting via REST or SOAP.. that would make it much easier to build a website and provide a same time the interfaces for mobile apps..