routing

Intermediate route optional parameters in Symfony 2

痞子三分冷 提交于 2019-12-02 02:31:29
问题 Problem to solve Is it possible in Symfony 2, define routes with ' intermediate ' optional parameters. I'll use other question data, for supporting me using the same style, for example: localhost /param 1/param 2/param 3/param 4 Example localhost /param 1/param 4 localhost /param 2/param 4 Because I have a problem where none of my parameters should be mandatory, and different logics come into play, subordinated to those activated parameters. Until now if I don't set like this: - localhost

Page transitions AND component animation in ReactJS

。_饼干妹妹 提交于 2019-12-02 01:42:20
My desired affect: When the page loads components A, B and C animate on independently The user clicks a link inside, say, component B Components A, B and C animate off independently A new page loads, more components animate on. This sounds simple but I'm struggling to make it happen. So far I have a number of routes setup using react-router v4 and I am using CSSTransitionGroup to add movement to routes and components. The problem I am having is: If a route is animated, I cannot seem to animate anything inside the component which is called. Certainly, the animation for when a component leaves

Web api - how to route using slugs?

本秂侑毒 提交于 2019-12-02 01:41:47
I would like to be able to parse links like this question is: http://stackoverflow.com/questions/31223512/web-api-how-to-route-using-slugs So route on the server simply ignoring the last part of the URL. As an example using this very question, how could I implement the routing correctly if somebody enters such an URL, it redirects me to: http://stackoverflow.com/questions/31223512 Referencing: Handling a Variable Number of Segments in a URL Pattern Sometimes you have to handle URL requests that contain a variable number of URL segments. When you define a route, you can specify that if a URL

CodeIgniter site in subdirectory, htaccess file maybe interfering with htaccess file in main directory?

六月ゝ 毕业季﹏ 提交于 2019-12-02 01:22:50
问题 In my CodeIgniter site (hosted on GoDaddy), navigating to any page but the index gives me this error: No input file specified. Googling around, it seems like the cause must have something to do with my .htaccess situation. The way this is set up, and maybe this can eventually change, is that my CI site is in a subdirectory of the main domain. The CI site and main domain each have their own .htaccess files. The CI htacess file is located in the applications folder: <IfModule mod_rewrite.c>

Spring returns HTTP 405 for every HTTP POST which isn't authorized

ぐ巨炮叔叔 提交于 2019-12-02 00:33:30
It seems like Spring isn't routing/authorizing HTTP POST requests correctly. When I send a HTTP POST request I always get "405 Method Not Allowed" response and this in the log file: org.springframework.web.servlet.PageNotFound - Request method 'POST' not supported The controller allows POST for the URL: @RequestMapping(value = "/mypostreq", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE) @Secured("ROLE_USER") public String mypostreq(@RequestBody String callBody, HttpServletRequest req, HttpServletResponse res) { return ""; } Here is the web.xml configuration: <context

Determine if path exists as route in Rails controller

孤者浪人 提交于 2019-12-02 00:32:30
问题 I want to know if an arbitrary path can be mapped to a route recognized_request_for accomplishes what I want, but I can't get it to work in my controller. Specifically, how can I execute recognized_request_for or something that accomplishes the same task from my controller? 回答1: For Rails 3 the call is Rails.application.routes.recognize_path Instead of ActionController::Routing::Routes.recognize_path Example: def path_exists?(path) begin Rails.application.routes.recognize_path(path) rescue

Rails 3 - Nested Resources Routing - One to One relationship

我是研究僧i 提交于 2019-12-02 00:26:45
Having some trouble with some nested resources routing. What I'm trying to do is link to a user's profile page for editing purposes. In my view it is written as: <%= link_to "Edit Profile", edit_user_profile_path(current_user) %> Which errors out with: No route matches {:action=>"edit", :controller=>"profiles", :user_id=>#<User id: 1, email: "EDITEDOUT", hashed_password: "EDITEDOUT", created_at: "2011-01-20 18:30:44", updated_at: "2011-01-20 18:30:44">} In my routes.rb file, it looks like so: resources :users do resources :profiles, :controller => "profiles" end I checked my Rake routes, and

Setting index route in Symfony 2

Deadly 提交于 2019-12-02 00:19:46
I've got Symfony2 installed, and a mostly working site, the only issue is I don't know how to set a default route. Currently, I access my index and other routes with the following URLs: www.example.com/app_dev.php/index www.example.com/app_dev.php/example_route I'd like to have www.example.com default to the index route, so I can get the same results with the following URLs: www.example.com www.example.com/example_route I'm running lighttpd as my web server. How can I configure lighttpd/Symfony2 to do this? Just create a route that maps to the / pattern : # app/config/routing.yml homepage:

Is there a way to redirect the browser from the bootstrap in Zend Framework?

北战南征 提交于 2019-12-02 00:12:46
I need to redirect according to some conditions in the bootstrap file. It is done AFTER the front controller and routes are defined. How do I do that? (I know I can simply use header('Location: ....) The point is I need to use the Router to build the URL. more than year later, i'm programming in ZF and I got this solution for your problem. Here is my function in bootstrap that determines where the user is logged on. class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { protected $_front; (...) protected function _initViewController() { (...) $this->bootstrap('FrontController'); $this-

Can I have a variable number of URI parameters or key-value pairs in Laravel 4?

江枫思渺然 提交于 2019-12-01 23:46:34
问题 I've got a shopping cart that I'd like to be able to pass a variable amount of optional parameters. Things like: sort by, filter by, include/exclude etc. So the URL may be: /products /products/sort/alphabetically /products/filter/cloths /products/socks/true /products/sort/alphabetically/socks/true/hats/false/ Etc. I suppose I could have a route with placeholders for all of the possible parameters and set default values in the URL, so something like: Route::get('products/sort/{$sort?}/filter/{