routes

angularjs + requirejs structure to build a huge modular app

不羁岁月 提交于 2019-12-08 03:59:57
问题 I'm trying to build a huge Modular Web App with AngularJs and RequireJS. This is my directory that I want to build: |--index.html |--css |--images |--libs | └--angular.js | └--angular-route.js | └--require.js | |--js | └--app.js | └--controller.js | └--module |--user | |--controller | | └--index.js (that is controller to list all users) | | └--add.js (this controller to add new user) | |--service | | └--user.js | └--template | └--index.tpl.html | └--add.tpl.html | └--photo |--controller | └-

How to use optional parameters at zend routing

寵の児 提交于 2019-12-08 03:56:39
问题 I want to set a similar routing to the standard-router with optional parameters, e.g.: intranet.route = 'intranet/:controller/:action/:title/:id' only the id-parameter doesn't need a value. i tried giving it an default value like null - but then the variable is still set, but i don't want it to exist at all when the user does not give it any value also, how can i set up a route with dynamic values, just like this: intranet/index/index/Front%20Page/123/foo/bar then the variable $foo exists

Nodejs very simple Form with Routes failing to post

烈酒焚心 提交于 2019-12-08 03:47:41
问题 I have a super simple form within a NodeJS/ExpressJS app which fails to post. The app.js code (I call it server.js) looks like this. var express = require('express'); var fs = require('fs'); var path = require('path'); var urlEncoded = require('urlencoded-request-parser'); var bodyParser = require('body-parser'); var server = express(); var port = process.env.port || 1337; server.use(urlEncoded()); server.use(bodyParser.urlencoded({extended: true})); var routePath="./routes/"; fs.readdirSync

Match route relative to path

╄→гoц情女王★ 提交于 2019-12-08 03:30:49
问题 I want any URL that ends with /templates/{filename} to map to a specific controller using either a route attribute i.e. something like: public class TemplateController : Controller { [Route("templates/{templateFilename}")] public ActionResult Index(string templateFilename) { .... } } which works, but the links referencing this route are relative so http://localhost/templates/t1 -- works http://localhost/foo/bar/templates/t2 -- breaks (404) I need something like: [Route("*/templates/

Different levels of URL with CakePHP routes

杀马特。学长 韩版系。学妹 提交于 2019-12-08 03:15:33
问题 I have a site that needs to allow multiple URL structures. For example: www.examplesite.com/people/add // <-- example company www.otherexample.com/xyz/people/add // <-- "xyz" company (not location based) www.otherexample.com/florida/abc/people/add //<-- "abc" company (location based) Each URL should be able to detect which company it is based on the URL. So far, I've been able to parse out the URL just fine to determine which company it is, but how to I add these extra /florida/abc/ parts to

How to reload a route using hasher.js and crossroads.js?

谁都会走 提交于 2019-12-08 03:12:12
问题 I currently have this code: crossroads.addRoute('/login', function(){ $.ajax({ url: '/login', type: 'GET', data: { }, success: function(msg) { $('#' + main_window).html(msg); } }) }); Along with this hasher.js for maintaining history: function parseHash(newHash, oldHash){ crossroads.parse(newHash); } hasher.initialized.add(parseHash); //parse initial hash hasher.changed.add(parseHash); //parse hash changes hasher.init(); //start listening for history change $('a').on('click', function(e) { e

Optimizing Zend framework routes

☆樱花仙子☆ 提交于 2019-12-08 03:02:04
问题 I'm using a traditional Zend framework application generated using Zend tool . I have several modules in my application all generated using Zend tool too. I'm intending to use the default routes in Zend framework in my application. For example: www.host.com/module/controller/action/param1/value1/param2/value2 Here are my questions: Performance wise, using the default routes is the fastest solution, right? Since I won't ever change the routes, is there a way to make the routing process even

MVC3 Routes with Different Parameter Types

杀马特。学长 韩版系。学妹 提交于 2019-12-08 02:47:55
问题 I am struggling to get my head around routing in MVC3. Previously I have generally just avoided the whole area and stuck with ugly old ?id=1&foo=bar type urls. Not nice. I have 4 routes defined thusly routes.MapRoute("Blog", "{controller}/{action}/{PageNumber}/{PostsPerPage}", new { controller = "blog", action = "list", PageNumber = UrlParameter.Optional, PostsPerPage = UrlParameter.Optional }); routes.MapRoute("Code", "{controller}/{action}/{title}", new { }); routes.MapRoute("Id", "

Automatic routing for page aliases in CakePHP

ⅰ亾dé卋堺 提交于 2019-12-08 02:25:15
问题 I am creating a CMS using CakePHP framework. Every page created through CMS will have its unique URL alias, depending also on virtual folder structure, example: www.site.com/level-1/about-us www.site.com/level-2/our-service User is available to create its own page, which will initially have the following address: www.site.com/pages/<page_id> and then create URL alias for it www.site.com/<page_alias> Page aliases are stored in database. How can I configure Routes to reflect these changes

Rails routes and controller parameters [closed]

天涯浪子 提交于 2019-12-08 02:11:32
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I have those two resources which share the same controller. So far, my approach was routing with an special type parameter: resources :bazs do resources :foos, controller: :foos, type: :Foo resources :bars, controller: :foos, type: :Bar end The routes work as expected, but all my links are like this: /bazs/1