N
N
New York Knicks2015-08-16 22:32:33
Network administration
New York Knicks, 2015-08-16 22:32:33

How to combine routes in Laravel and Backbone?

I'm doing SPA on Backbone + Laravel 5.
There was a problem with routes.
There is an application template and a content area that changes without reloading the page.
Here, when going through the #profile/#list routes, etc. you need Laravel to collect the data and pass it to the appropriate models.
Laravel doesn't understand routes like "/app#profile" and in Backbone all routes are based on hashtags.
Please tell me how to implement.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2015-08-16
@HumanEx

Laravel routes and Backbone routes are completely different things; they don't need to be friends with each other.

There is an application template and a content area that changes without reloading the page.
Here, when going through the #profile/#list routes, etc. you need Laravel to collect the data and pass it to the appropriate models.
This is not Laravel supposed to do, but just Backbone. On Laravel, you need to implement a REST API (or whatever you want) that Backbone will work with.
In fact, Laravel in this bundle is used only to render the application's start page and as a backend for Backbone models. All application logic is implemented in Backbone, so their routes do not need to be connected.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question