Ember with Yii REST backend,demo application. ¶
- A one page web application built with Ember.js and Ember-Data.Uses the default REST Adapter of ember-data as a Persistence Layer and a Yii REST API as a backend.
- Setting It Up.
- Best Ember.js Tutorial.
- Personal View on js framework choice.
A one page web application built with Ember.js and Ember-Data.Uses the default REST Adapter of ember-data as a Persistence Layer and a Yii REST API as a backend. ¶
This demo uses an old ember.js and ember-data version.The framework has gone through a lot of API changes since this article was published.This demo will not work with the most recent ember version.
Setting It Up. ¶
Clone the git repo -
git clone git://github.com/drumaddict/ember-yii.git - or download it
To install,follow these steps.
- Hook up your Yii framework path in index.php.(Tested with version 1.1.12.)
- In config/main and config/console.php fill in your database info.
- Run the migration in migrations folder.(In console,navigate to protected folder and type yiic migrate and respond to dialog).Or just use the sql dump in data folder.
- You may need to change the store.adapter.namespace property on app/application.js,the logout url in app/routes/app_router.js,and login url in app/controllers/login_controller.js (sendCredentials function),according to your application root folder path.
- Use one of the two .htaccess files found in root folder.
- Navigate to /site/app.The actionApp action in SiteController will render the site/contacts_app.php view without a layout.From there require.js will load the app/main.js file which functions as a bootstrap file for the contacts application.
Best Ember.js Tutorial. ¶
Advice on & Instruction in the Use Of Ember.js. This is an extended ember tutorial that I suggest in order to understand ember thoroughly. It also mentions backbone and how it compares with ember,very useful if you are still overwhelmed and stuck with the choice of a js framework.
Personal View on js framework choice. ¶
I have not investigated every possible js framework out there.I did look into backbone though. I liked the simplicity and good documentation,but it lacks a well defined structure.Ofcourse it is possible to overcome this with additional backbone libraries /dependencies like Backbone Marionette, but to me this is not an attractive idea,as you have to keep all these additions in sync with backbone,as the codebases evolve. Also I am not too keen on having to think about event binding cleanup,and this is something to consider when coding with backbone. Ember on the other hand,features a clear MVC separation of concerns.Binding data to views is automatic,just declare controllers and their associate views, and every time data changes,views update automatically without explicitly writing any code.I have a background in Flex Actionscript Framework and coding js with ember sometimes felt a lot like flex. For your research on js frameworks ,I suggest TODO MVC.Helping You Select an MV* Framework..