routing

KohanaPHP 3 Routing Issues

若如初见. 提交于 2019-12-25 08:14:12
问题 I'm having a route for user controller. This controller has about 20 methods so I don't want to set them manually in routes: Route::set('user', 'user/<action>') ->defaults(array( 'controller' => 'user', 'action' => 'index', )); I have also pictures controller (Controller_User_Pictures) with multiple methods that is used to manage users pictures. When I create a route: Route::set('pictures', 'user/pictures/<action>') ->defaults(array( 'directory' => 'user', 'controller' => 'user_pictures',

Codeigniter router to pass url segment as $_GET query

余生颓废 提交于 2019-12-25 07:49:42
问题 How can I set codeigniter to route this: /download/folder/file.ext to this /download?path=folder/file.ext ? I know how to do it using .htaccess , but is it possible in CI only? I tried $route['download/(:any)'] = "download/index/?path=$1"; didn't work ... thanks 回答1: I urge you to change your perspective of what the CI Router class does (this was the most difficult thing for me in moving from the "rewriting" approach to the "router" approach). Your question assumes a "rewriting" approach, and

Angular not routing properly. URL is localhost:8081/#!/#pageName

被刻印的时光 ゝ 提交于 2019-12-25 07:48:39
问题 I am making a simple Angular application that has an index.html which loads other HTML pages as views based on which navbar item selected; however, the routing is not working as expected. The main.html view is loaded fine, but none of the other views are loaded, and the URL is not what I expect. The URL that shows up in the browser after an item is selected is localhost:8081/#!/#pageName . I do not know where the '!' is coming from, and there should not be a hash before the pageName. The URL

Route on Laravel keeps redirecting (301) to root of website

我的未来我决定 提交于 2019-12-25 07:48:15
问题 I have an application using the A2 host provider, and inside the public directory its my laravel folder (www.website.com/app) And in my server preferences I am redirecting the root "/" to "/app" The app was OK, but today started to redirect a Route in specific.. Route::get('/postagens/{Alias}/{dataInicio?}', array( 'as' => 'artista.get.posts.all', 'uses' => 'ArtistaController@getPostsMainFeed' ) ); Inside the generated HTML, it makes: http://www.website.com/app/artista/posts/twitter/ but when

How to set up elasticsearch routing on existing index?

孤者浪人 提交于 2019-12-25 07:39:37
问题 I have an index which uses the default routing of elasticsearch. Now I want to set up my own routing, how do I implement this? The example in the official doc is: $ curl -XPUT 'http://localhost:9200/store/order/_mapping' -d ' { "order":{ "_routing":{ "required":true, "path":"customerID" } } } After doing this, do I need to reindex of even rebuild the whole index? 回答1: If you want to change the routing behavior in an existing mapping type, you need to create a new index, recreate the mapping

Apache Camel Tracer | Would log level make a difference in the amout of information logged

雨燕双飞 提交于 2019-12-25 06:26:19
问题 am exploring the usage of Tracer for logging purpose. It can be managed via JMX Console, so logging can be enabled even when developers haven't used logs in their routes. My concern is that Tracer seems to output the same amount of information irrespective of the log level set. Is this case or I am missing something. I am enabling tracing on the route in the Route Builder: getContext().setTracing(true); Date d = new Date(); from("file://c:/test?include=myTest.*.txt&noop=true").routeId(

Is it possible to redirect a url that uses HTTPS protocol? (Heroku, Rails)

▼魔方 西西 提交于 2019-12-25 06:18:21
问题 I switched my app's domain, and the redirect works for urls that use http, but I have some links lurking around on the web using HTTPS that aren't redirecting. For instance, http://myolddomain.com redirects just fine, but https://myolddomain.com results just returns a generic server error. Is it possible to redirect these links? I'm using rails 3 and heroku. UPDATE: I'm trying the rack-rewrite gem. Here's the code that I'm adding to my production environment file: #mod_rewrite using rack

jQuery Mobile: how to open url hash with parameter?

こ雲淡風輕ζ 提交于 2019-12-25 05:57:09
问题 I'm using jQuery Mobile 1.2.0 It's impossible to open hash with parameter. Works - http://jquerymobile.com/demos/1.2.0/docs/pages/multipage-template.html#two Doesn't work http://jquerymobile.com/demos/1.2.0/docs/pages/multipage-template.html#two?id=33 回答1: It's not supported officialy, but there are workarounds. In the docs you can read more abot this (search for passing parameters under known limitations). Quoting: jQuery Mobile does not support query parameter passing to internal/embedded

System.Web.Routing only working with a .aspx file extension

China☆狼群 提交于 2019-12-25 05:16:11
问题 I have an application, that uses System.Web.Routing and it works great on all my environments. The only issue is, that my staging environment needs the ".aspx" at the end or I will get a 404. All other environments do not require it. They all run in Classic for the Managed Pipeline Mode with v4.0 .NET framework. I keep comparing IIS settings, but I can't find any differences. I've even compared web.config and machine.config , but no differences there either. Anybody know what it could be? 回答1

rails - how to make a GET request to action with parameters

▼魔方 西西 提交于 2019-12-25 05:15:14
问题 I'm hoping this problem is a fairly simple one as I am relatively new to rails development. I am trying to make a get request from a controller with a specified action and pass required parameters. This is the relevant code in the helper class: module ChartsHelper def chart_tag (action, height, params = {}) params[:format] ||= :json path = charts_path(action, params) content_tag(:div, :'data-chart' => path, :style => "height: #{height}px;") do image_tag('loading.gif', :size => '32x32', :class