url-routing

Web API route is ignored and processed by MVC

陌路散爱 提交于 2019-12-07 16:13:44
问题 I can't figure out why a route is being processed by MVC instead of Web API. The whole route is configured as follows: configuration.Routes.MapHttpRoute ( name: "AdminControllers.TicketingController", routeTemplate: "api/company/tickets", defaults: new { controller = "Ticketing", id = RouteParameter.Optional, action = "GetTickets" } ); And the API controller looks like this: public sealed class TicketingController : ApiController { [HttpGet] public HttpResponseMessage GetTickets() { return

Multiple levels in MVC custom routing

旧街凉风 提交于 2019-12-07 15:50:31
I am trying to build my own little cms. I created an abstract pageBase class that is inherited by Static, Reviews, Articles, News. Each having there own controller methods. My problem is that I need to allow the admin to define his own custom path levels. E.g. news\local\mynewdog or Articles\events\conventions\mycon . So I would like a way to pass an array of strings and also set the custom routing. You can make CMS-style routes seamlessly with a custom RouteBase subclass. public class PageInfo { // VirtualPath should not have a leading slash // example: events/conventions/mycon public string

CakePHP log in redirect to requested URL

主宰稳场 提交于 2019-12-07 14:06:44
问题 When a user clicks a link that requires a log in, we currently redirect them to the log-in page ,but we lose the intended URL. What is the best way to account for that URL and redirect the user to the requested page once logged in? We're using the latest stable version of Cake. Thanks. --Edit-- Its configured like this $this->Auth->loginAction = array('controller' => 'users', 'action' => 'login'); $this->Auth->logoutRedirect = array('controller' => 'users', 'action' => 'login'); // $this-

Using multiple database on same CodeIgniter 2.x application and issue with URI Routing

人盡茶涼 提交于 2019-12-07 12:20:56
问题 I am working on a small web application. In my application I follow the following approach. Small overview of system The Application will be hosted on the server for example (www.example.com ) Clients such as Microsoft, Cocacola, IBM.... etc will sign up. And the clients will access the application by using url like this ( www.example.com/ibm ) Each client will have separate database to store their data. If the employees of the client want to login into the system then the url pattern should

Processing URL parameters - name value pairs separated by slashes

丶灬走出姿态 提交于 2019-12-07 12:10:21
问题 I want to have URLs like :- URL 1 - www.projectname/module/search/param/1 URL 2 - www.projectname/param/1/module/search I want a PHP code which takes the above URLs as parameter and returns an array like Array("module" => "search", "param" => 1) (for URL 1) Array("param" => 1, "module" => "search") (for URL 2) So that I can use the result as $_GET in my project. I came to know that it would be better and easier to do this with PHP than with htaccess rewrite rules. If you can help with rewrite

Nested details route with react-router not rendering

送分小仙女□ 提交于 2019-12-07 11:43:21
问题 I am using the react-router plugin to setup my routes I want to provide two routes list/ and list/:id (pretty common) What I have and what's working is this: <Routes> <Route handler={App}> <Route name="list" handler={ListComponent} collection={new Collection()}> </Route> </Route> </Routes> But I am struggling to get my "details" route to work. What I tried is: <Routes> <Route handler={App}> <Route name="list" handler={ListComponent} collection={new Collection()}> <Route name="list.details"

Default-Route for root of application

我怕爱的太早我们不能终老 提交于 2019-12-07 11:17:46
问题 How can I tell my mvc -application to route to a specific Controller and Action when they are not specified? When debugging http://localhost:54500/ should route to http://localhost:54500/Home/Index . Currently I have: routes.MapRoute( name: "Root", url: "", defaults: new { controller = "Home", action = "Index" } ); routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { id = UrlParameter.Optional } ); But this always throws The view 'Index' or its master was not

How to get the same $_SERVER['REQUEST_URI'] on both localhost and live server

本小妞迷上赌 提交于 2019-12-07 10:18:54
问题 So this is the thing, Im building dispatcher class that needs to dispatch http requesd based on Request URI, so Im interesed only in part of URI that comes behind domain. Now when im working on live server on URI like this: www.domain.com/controller/method/params/ REQUEST_URI would return: /controller/method/params/ But when im working on local machine i have URI like this: localhost/project/controller/method/params/ and REQUEST_URI would return: /project/controller/method/params/ So is there

Opencart Admin Cron Jobs

馋奶兔 提交于 2019-12-07 08:28:58
问题 I am know about CRON and how to create / manage it. But this issue was different. I want to develop a module to delete any (unpaid) order that exceed the time frame given. Ex : I want to delete any unpaid order that has not been paid for 2 days after the order was placed. I want to use existed model in opencart (and not use a new one). Lets say the module URL would be : http://www.yourstore.com/admin/index.php?route=module/modulename/function And will be called from CRON, and then all any

Ionic navigation tab in header

给你一囗甜甜゛ 提交于 2019-12-07 08:09:04
问题 Hey i've got a question about ionic navigation, The main navigation of my application is in the footer, but i want to add an information tab to the header, I also want this tab to have it's own view so i set it up as seen below <ion-nav-bar class="bar-stable nav-title-slide-ios7"> <ion-nav-back-button class="button-icon icon ion-ios7-arrow-back"> Back </ion-nav-back-button> <ion-nav-buttons side="right"> <ion-tabs class="tabs-icon-top"> <!-- Info Tab --> <ion-nav-view> <ion-tab title="Info"