Sysrq147
Sysrq147

Reputation: 1367

Filling Backbone model with data from Laravel Cache

Is it possible to fill Backbone model with data from laravel cache, and how can I do it ?

Upvotes: 0

Views: 185

Answers (1)

Chris
Chris

Reputation: 7853

Even if i don't know laravel i think this is quite possible. You only need to "render" or "print out" your laravel cache into a JavaScript code block. Please also see Passing PHP variable into JavaScript to see how you can pass values from php to JavaScript.

A good solution would be, if you can render out your laravel cache to json form and then pass this to the "model.set()" method of your Backbone model.

Upvotes: 1

Related Questions