0
我有一個應用程序,它主要文件看起來像這樣的(1),(2),(3)。骨幹路由器......如何處理URL
的Backbone.Router在這種情況下正常工作(因爲它觸發#page
):
http://localhost/index.php#page
我應該如何配置它,如果是以下URL(爲了觸發/some#page
):
http://localhost/index.php/some#page
PS:
這個Web應用程序的後端使用Synfony2
(1)
// index.php
<script data-main='mainApp.js' src='require.js'>
(2)
// mainApp.js
define([
'js/router'
], function(Router) {
"use strict";
var initialize = function()
{
Router.initialize();
}
return {
initialize: initialize
};
});
(3)
// router.js
define([
'myView'
], function(MyView){
console.log(MyView)
var AppRouter = Backbone.Router.extend({
routes: {
'page' : 'view'
},
view: function() {
//some code
}
});
});
非常感謝,我沒有修復它。 –
@LorraineBernard:甜的! –