AngularJS路由设置格局

//路由安装(短链接设置)
‘URL_ROUTER_ON’ => true,
‘URL_ROUTE_RULES’ => array(
‘log’ => ‘Login/index’,
‘admin’ => ‘Login/admin’,
‘reg’ => ‘Login/register’,

 

‘c/:id’ => ‘Index/index/user’

Module.config(['$routeProvider', function($routeProvider) {
    $routeProvider
    .when('/mall-home', {
        templateUrl: "template/mall-home.html?0726",
        controller: 'mallHome',
    })

    .when('/shake-home', {
        templateUrl: "template/shake-home.html?0726",
        controller: 'shakeHome'
    })

    .otherwise({        //路由地址有误跳转此路由
        redirectTo: '/mall-home'
    });
}]);

‘/^C_(\d+)$/’ => ‘Index/index/user?id=:1’
),

 

长链接:http://localhost/index.php/'Index/index/user/c/9

减少成以下:

短链接:http://localhost/index.php/c/9

 

短链接:http://localhost/index.php/C\_9


发表评论

电子邮件地址不会被公开。 必填项已用*标注

网站地图xml地图