url-routing

How to specify a dynamic root URL in Ember.js?

让人想犯罪 __ 提交于 2019-12-05 09:27:31
Ember allows for a root URL to be specified on the router here: http://emberjs.com/guides/routing/#toc_specifying-a-root-url App.Router.reopen({ rootURL: '/blog/' }); Is there a way to specify a dynamic URL like: /:region/:locale/ ? The rootURL assignment seems to only accept a literal string. Assets (including Ember) are being loaded from a common directory like /assets/ . You can set rootURL dynamically within Router.init method, e.g. App.Router.reopen({ init: function() { // set rootURL using regex to extract appropriate // rootURL based on current window location this.set('rootURL', window

Phalcon Router and Loader for subfolder structure getting bigger. How to set up?

馋奶兔 提交于 2019-12-05 08:40:47
I have a quite big project that I need to program. I used to code with CodeIgniter but since they stopped maintaining the framework, I decided to switch to another. I chose Phalcon framework. The folder structure of the application that I want to implement is next: app/ controllers/ admin/ users/ UsersController.php UserGroupsController.php dashboard/ system/ another_subfolder/ AnotherSubFolderController.php production/ settings/ SettingsController.php dashboard/ flow/ another_subfolder/ AnotherSubFolderController.php website1/ customers/ CustomersController.php CompaniesController.php another

Redirecting an old URL to a new one with Flask micro-framework

六月ゝ 毕业季﹏ 提交于 2019-12-05 08:38:49
I'm making a new website to replace a current one, using Flask micro-framework (based on Werkzeug) which uses Python (2.6 in my case). The core functionality and many pages are the same. However by using Flask many of the previous URLs are different to the old ones. I need a way to somehow store the each of the old URLs and the new URL, so that if a user types in an old URL they are simply forwarded to the new URL and everything works fine for them. Does anybody know if this is possible in Flask? Thank you in advance for your help :-) Something like this should get you started: from flask

Ember.js Routing: match end of url

倖福魔咒の 提交于 2019-12-05 08:31:36
I need to match a path into an URL. The path has to be the end of the URL after a given pattern, but I can't do it. Ember.js always end it's matching to the next slash. var router = Ember.Router.extend({ location: 'history', enableLogging: true, root: Ember.Route.extend({ index: Ember.Route.extend({ route: '/' repo: Ember.Route.extend({ route: '/:repo_id', index: Ember.Route.extend({ route: '/' }), files: Ember.Route.extend({ route: '/files', index: Ember.Route.extend({ route: '/' }), sub: Ember.Route.extend({ route: '/:path' }) }) }) }) }) }); With this router: /myrepo/files/ will match root

angularJS nested abstract views

假如想象 提交于 2019-12-05 07:48:24
I am using StateProvider library to create nested views in my AngularJS app. I had an abstract view defined at the root and now need to define another abstract view as 2nd level child to the previously created abstract view. Facing issues with this, Not sure if I can have nested abstract views or not. Any idea. greatly appreciate your help. Thanks There could be more abstract-nested states in hierarchy. This example shows it in action, definition of these states could be like this: $stateProvider .state('main', { url: "", abstract: true, templateUrl: 'tpl.main.html', }) .state('main.middle', {

ASP.NET 4.0 Routing and Subfolders

谁都会走 提交于 2019-12-05 07:01:45
问题 I have a folder structure like this: www.mysite.com/About/About.aspx I have a link in a user control like this: <a href="~/About/About" id="aboutLink" title="About" runat="server">About</a> And in my RegisterRoutes() method, I have this: routes.MapPageRoute("", "About/About/", "~/About/About.aspx"); It works but produces the following URL: www.mysite.com/About/About What I would like is this: www.mysite.com/About Is this possible with out-of-the-box 4.0 routing? UPDATE 2 - 05-14-2010:

Nested Routing Behavior for Ember.js

[亡魂溺海] 提交于 2019-12-05 04:42:28
问题 Can someone explain the behavior of the router and nested routes in Ember.js? What are the resulting URL, RouteName, Controller, Route, and Template? App.Router.map(function(){ this.resource('profile'); // URL: /profile // RouteName: profile // Controller: ProfileController // Route: ProfileRoute // Template: profile this.resource('artists', function(){ // URL: /artists // RouteName: artists OR artists.index // Controller: ArtistsController OR ArtistsIndexController // Route: ArtistsRoute OR

Angular: Setup routes depending on service method call

末鹿安然 提交于 2019-12-05 04:31:01
I have route configuration set up via @NgModule . And I have a service that identifies what parts of the application should be shown for the user depending on certain conditions. I need to call that service and setup the routes according to the returned value. Problem: Route configuration is setup inside an annotation and I can't get how to call the service in such setup. To be more specific here is the example configuration I want to enhance. My current routing setup: const appRoutes: Routes = [ { path: '', redirectTo: 'first-route', pathMatch: 'full' }, { path: 'first-route', component:

How to create a default method in SpringMVC using annotations?

夙愿已清 提交于 2019-12-05 03:28:33
I can't find a solution to this, and it's driving me crazy. I have @Controller mapped that responds to several methods using @RequestMapping. I'd like to tag one of those methods as default when nothing more specific is specified. For example: @Controller @RequestMapping("/user/*") public class UserController { @RequestMapping("login") public String login( MapModel model ) {} @RequestMapping("logout") public String logout( MapModel model ) {} @RequestMapping("authenticate") public String authenticate( MapModel model ) {} } So /user/login -> login method, /user/logout -> logout, etc. I'd like

Routing for category tree

放肆的年华 提交于 2019-12-05 02:55:45
问题 I am using the Tree doctrine extension for a category tree and would like to have routes like: /cat/subcat1/subcat2/subcat3 I can do it defining routes like /{cat} /{cat}/{subcat} /{cat}/{subcat}/{subcat2) etc... But is there a more elegant and general way of implementing this? A system that can accept an unlimited number of levels? 回答1: What you can do is accepting slashes in your routing parameters (for this route only). It involves that you can't queue any other parameter as slash