routes

Symfony routing ajax get method

对着背影说爱祢 提交于 2019-12-11 13:00:08
问题 I pass by ajax GET parameters, my url looks like: example.com/autocamplete?term=string I add route for that: autocomplete: path: /autocomplete?term={term} defaults: { _controller: CatalogWebBundle:Default:autocomplete } But it something wrong with my route, because I get error: GET http://127.0.0.1:8000/autocomplete?term=sdfsd 500 (Internal Server Error) How to rewrite my route to ajax get patameters ? JS is: <script type="text/javascript"> $(function() { //autocomplete $("#search")

How to use ruby on rails named routes

独自空忆成欢 提交于 2019-12-11 12:59:17
问题 I defined nested resources like this resources :item, :only => [:create, :destroy, :update] do resources :item_image, :only => [ :new, :create, :show , :destroy, :index] end And my routes look like this (output of rake routes) item_item_image_index GET /item/:item_id/item_image(.:format) item_image#index POST /item/:item_id/item_image(.:format) item_image#create new_item_item_image GET /item/:item_id/item_image/new(.:format) item_image#new item_item_image GET /item/:item_id/item_image/:id(.

cant use [routerLink] inside the component

寵の児 提交于 2019-12-11 12:46:44
问题 Im have 2 <router-outlet> and everything is ok,this my RouteConfig inside the profile component: @Component({ selector : "profile", templateUrl: '/client/tmpl/profile.html', directives: [ ROUTER_DIRECTIVES], }) @RouteConfig([ {name: 'Home', component: homeProfile ,path: '/' ,useAsDefault:true}, {name: 'Credit', component: credit ,path: '/credit' }, {name: 'BuyCredit', component: buyCredit ,path: '/buycredit' } ]) my problem is when I want use [routerLink] inside the credit component throw an

Admin route in custom modules

谁都会走 提交于 2019-12-11 12:37:09
问题 All stock magento modules have URL path in backend which has 'admin' (by default) part. However I was not able to achieve that for a custom module. Is this not possible or done on a purpose? Thanks 回答1: The first part of the URL is known as the "frontName". http://example.magento.com/frontName/controllerName/actionName Magento only allows a single module to claim a particular frontName. For the admin frontname, that's Adminhtml . However , Magento 1.3 introduced a configuration syntax that

How to add file type extension using .htaccess?

孤街醉人 提交于 2019-12-11 12:23:13
问题 I want to map links like http://example.com/STRING to http://example.com/STRING.png , how to do it with .htaccess? 回答1: Try the following code in htaccess : RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.png -f RewriteRule ^([^/]+)/?$ /$1.png [NC,L] 回答2: Try: RewriteEngine on RewriteCond %{REQUEST_URI} ^/(.*)$ RewriteCond %{DOCUMENT_ROOT}/%1.png -f RewriteRule ^(.*)$ /%1.png [L] 回答3: This one should, theoretically (I haven't tested it), redirect to first

Laravel 5 Route with multiple ID’s

冷暖自知 提交于 2019-12-11 11:52:29
问题 I would like to pass two sets of ID’s into a route. The first ID is that of the authenticated user so for example 3 and the second is that of a candidate. So what I would like it to do is: vault/3/candidates/120 Here is the route I want to have: Route::get('vault/{id}/candidates/{id}', 'CandidateController@centreCandidatesShow'); Using: ublic function centreCandidatesShow($id) { $candidate = Candidate::with('qualification')->find($id); return view('vault.show', compact('candidate')); } Could

Android google route using 3 points (Source point, destination point and via point)

雨燕双飞 提交于 2019-12-11 11:44:31
问题 I am using google map to display route between two points . Now in my application i want to draw route in map using source point , destination point and via point.Please help me in this. Any help would be appreciated. Thanks in Advance 回答1: Check this: Answer : Draw path between two points using Google Maps Android API v2 But modify makeURL method to use https://developers.google.com/maps/documentation/directions/#Waypoints makeURL(double sourceLat, double sourceLng, double viaLat, double

zf2 navigation breadcrumbs paging

末鹿安然 提交于 2019-12-11 11:31:39
问题 Cannot find the right way to describe sitemap that works with breadcrumbs. For example i have a navigation described in module.config.php 'navigation' => array( 'default' => array( array( 'label' => 'Home', 'route' => 'home' ), array( 'label' => 'Articles', 'route' => 'articles', 'pages' => array( array( 'label' => 'Paging', 'route' => 'articles', 'id' => 'articles', 'pages' => array( array( 'label' => 'Page 1', 'route' => '1' ), array( 'label' => 'Page 2', 'route' => '2' ) ... ) ) ) ) ), ),

MVC Web Api Route with default action not working

别说谁变了你拦得住时间么 提交于 2019-12-11 10:50:08
问题 In my TestController I have the following: [HttpGet] public IEnumerable<String> Active() { var result = new List<string> { "active1", "active2" }; return result; } [HttpGet] public String Active(int id) { var result = new List<string> { "active1", "active2" }; return result[id]; } In RouteConfig the mapping is: routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } ); routes.MapHttpRoute( name: "ActionApi", routeTemplate

.net core routing to a razor pages area based on current domain name?

折月煮酒 提交于 2019-12-11 10:43:46
问题 I'm currently trying to architect a application to host multiple websites from a single .net core application. Ideally, I would like to show completely different Razor pages based on the domain name the application is being accessed from. Ideally, I would like to have my razor pages broken down into areas, where each area is associated with a different domain name. IE www.domain1.com is the domain1 area, www.domain2.com is the domain2 area, and each area has it's own index about page etc. So