URL routing lets you configure an application to accept request URLs that do not map to physical files.

learn more… | top users | synonyms

1
vote
1answer
19 views

Parsing $referer string or using 2 route names for the same action

In my web-app, it is possible to delete an Item when visiting any of 4 different pages: the Show Item page the Edit Item page the List Items page the List Items in Room page If the visitor uses a ...
3
votes
1answer
83 views

Haskell REST API + PostgreSQL

I'm making some small REST API, which I have never done before. I've got some basic stuff working. Now my job is to add new entities to this, but all my work is reduced to copy-pasting code I have ...
1
vote
1answer
103 views

Router class in PHP

I am building a small and 'simple' PHP framework to see if I can bring my PHP skills to a new level and to review the knowledge I have required during OOP classes and tutorials I've done. Currently, ...
6
votes
1answer
53 views

Web Development DSL

I'm working on a DSL for web development, similar to sinatra. The git repository is here. I've been attempting to improve this code and write it for 4 months, and as a hobby programmer, I would like ...
0
votes
0answers
49 views

Express.js MVC controller router

So in the vein of an old dog trying to learn new tricks, I've decided to try to polish up my JavaScript skills. I've used it a lot but I don't claim expertise. I'm looking for any critique on the ...
0
votes
0answers
36 views

Path router for Hyper

I'm working on a path matcher/router library for use with (stable) Hyper server. I'm pretty happy with its current API and performance, but would like to get some feedback. It can be used (inside a <...
-1
votes
1answer
57 views

Protect against XSS with .htaccess file

My .htaccess redirects everything to my index.php, but I wonder if it's vulnerable to XSS attacks. Am I safe? .htaccess file ...
1
vote
0answers
27 views

Matching URIs with regexes for Apache CXF InInterceptor

In my project I need to compare the URI with 15+ regex patterns. Currently I have used a if ladder to execute the appropriate code if any of them gets matched. ...
0
votes
1answer
128 views

Simple PHP CRUD application with Google Maps

I've got some experience with Laravel but for fun I started a small project (basically a CRUD with also Google Maps) without a framework because I considered that is oversized. This is the directory ...
1
vote
1answer
471 views

Dynamic Routing PHP MVC

I'm creating a simple MVC framework for a new version of my website I'm working on. Currently I have simple routing, such as /about-us etc ... I've just implemented 'my version' of dynamic routing. I ...
5
votes
2answers
93 views

Securing PHP using a gateway that consults a whitelist

My site was recently infected and running malicious scripts. Once I discovered this, I cleared everything, the hosting company re-initialized the VPS and I setup my site anew. This is how I run my PHP ...
1
vote
1answer
83 views

Simple router for updating users

I need to know if I am going in the right direction with my code so far. I am really trying hard to transition from procedural, page-based programming into OOP MVC. So far I have written a simple ...
3
votes
1answer
48 views

Redirecting to the appropriate URL for some type of notification

I have a polymorphic notification model with action attribute. When user clicks on a notification he/she should be redirected to given page the notification refers to through notifiable. What is the ...
1
vote
0answers
35 views

FlowRouter auto-redirect on login page

The site should be accessible only to signed-in users. I'm making sure I publish and enable data manipulation to only those, but I wanna make sure even the app structure won't be visible. What I did ...
1
vote
1answer
130 views

Uri Routing PHP Code

I do programing with core php & i don't want to like use any cms or mvc framework. if any handy ideas then welcome it. index.php file ...
3
votes
0answers
174 views

PHP routing system

I made a routing system for PHP inspired by Symfony's router composed of a few classes. First I am using Symfony's HTTP Foundations component. Then, I am emulating the classes in the routing ...
5
votes
2answers
1k views

As basic as routing in PHP can get

I'd like to have neater URLs, no more and no less — I'd like to be able to write /page/subpage instead of something like ...
1
vote
2answers
213 views

Static single page app with routing

I'm currently trying to write an app with Cordova and ReactJS. I haven't used ReactJS before, so I'm very confused by the mixed usage of Babel, JavaScript and JSX. I try to use JSX where I can because ...
4
votes
1answer
253 views

PHP Route class

I was trying to keep it SRP. I'm new into PHP OOP and I'm wondering how I can make it better. Route.php ...
5
votes
2answers
135 views

Simple JavaScript router with params

I am building a JS router and would like to have some help doing it. It will work like so: A list of routes is given with a URL pattern attached in each one. ...
3
votes
1answer
946 views

Creating an object-oriented router class in PHP

On my way to learn OOP, I am developing a little CMS using the MVC pattern. I would like to have some feedback about my router class, mostly about if I am correctly using OOP. Right now, I have a ....
5
votes
1answer
119 views

Router to match URL to Controller Method

I wrote a router class which accepts a URL and calls the appropriate controller method based on it. I'm a little worried about the amount of dependencies it has (eg ...
6
votes
0answers
423 views

AngularJs Module Run Block, Configuration, and Route Definition

My AngularJs app is currently working fine. I'm working on modularity, refining my code design, and making it more readable. I have a app.js file that contains the ...
3
votes
2answers
268 views

CakePHP static pages (without entity) but with dynamic content

I have a few pages that is not connected with entities (index page, terms of use page, email page). Detailed description: In CakePHP, when you want to have a static page (such as index for example), ...
4
votes
2answers
95 views

Gathering tokens from ASP.NET routes

This is one of the (many) utilitarian classes I have that I use with my ASP.NET sites. The basis of this one is to make gathering certain tokens that I use periodically, to make URL's more friendly. ...
5
votes
3answers
73 views

UrlRouter which uses regular expressions to find out what to do

I have created UrlRouter. It should call appropriate controllers methods with extracted values as a parameters. It works fine, but my boss told me that I should ...
4
votes
2answers
93 views

Dissecting URLs

For the request object in my PHP application, I need to dissect the URL and assign its components to class attributes (module, controller, method and the rest are parameters). Currently, I'm doing it ...
1
vote
1answer
59 views

Is dynamically generating routes from Model enum safe?

I am generating routes and responding to it dynamically by looking at the enum defined in the model. Is this safe and is there more proper method? ...
1
vote
1answer
309 views

Routes for a user controller in a Node.js application

I have a very simple Node application that routes requests to /users to the following file: users.js ...
5
votes
1answer
368 views

Small PHP-MVC system (for personal learning / use)

I've made an "simple" / "small" MVC-like PHP system. I've used some code of an project I used before and ask questions about it back then to. The thing is, it works (the admin part to begin with), ...
3
votes
0answers
4k views

Simple Router class

I made a simple routing class that I like to get reviews for, mostly because I do not know how to make it SOLID, since I even made this class separate from the HTTP response/request for the sake of ...
0
votes
1answer
198 views

MVC router class performance

Can you review my code? ...
0
votes
1answer
139 views

Properly Structured Angular Application

I've been writing a somewhat complicated service that involves a lot of API function calls in Angular. After a somewhat tortured first attempt I have tried to take more of an MVC approach rewritten ...
3
votes
0answers
174 views

PHP MVC Service Layer Role

I wrote a series of questions in a previous post, and a user recommended that I separate the questions. I have made the switch from procedural programming to object-oriented programming. I have ...
2
votes
1answer
164 views

PHP MVC simple controller design

I am currently rewriting a legacy PHP4 application to a MVC-style object-oriented one. As the most complex part is the models, I came up with the following controller-view scheme. I wanted to use only ...
2
votes
1answer
107 views

Parameterized route

Is this approach considered good practice, or should I create separate router.delete functions for all my routes? Please, explain why. ...
2
votes
1answer
624 views

Implementation of MVC Bootstrap & Factory

Before I get started, I feel I need to list the following. I am not looking for an existing DI or Framework this is a personal project to shift from procedural to oop programming. Tear this apart. I ...
2
votes
1answer
753 views

Unit tests for a Laravel site

Is this Test Case overkill? I am new to Unit Testing so I am learning and I'd love to hear your opinion about it. ...
4
votes
1answer
1k views

N-layered application structure in ASP.NET MVC 5

I've been trying to set up an n-layered application in ASP.NET MVC 5. I've converted my account controller to look like this. I would like some feedback as to whether this is going in the right ...
2
votes
1answer
823 views

Extending the MVC Routecollection

I'm currently developping an MVC framework on which I will be writing my websites. This is done through the usage of a starter kit. In standard MVC, your routes are registered like the following: <...
5
votes
2answers
555 views

Rails controller action methods corresponding to static web pages

One of my rails controllers is horribly overcrowded with a bunch of methods that link to static web pages. Controller ...
2
votes
1answer
131 views

Redirecting to a file

I've been learning how to code for the past three years. I have made some really good progress I think, and right now I'm trying myself on creating an MVC framework. I found this awesome idea on ...
4
votes
2answers
148 views

Would this be considered MVC?

For many days, I've been re-designing my application, applying some custom pattern and making our code looks like a framework. I have something like this for separate the business logic, from views: <...
6
votes
2answers
2k views

PHP Router for MVC

I recently started developing my first serious project in PHP, a MVC completely build by myself, which is quite a challenge, when being new to OOP. So the main struggle of the whole project has, and ...
0
votes
1answer
123 views

URL router that loads dependent objects

How can I write my code more efficient (not repeating same code)? And is there a solution that simplifies the way of having to create a lot of dependency objects over and over again whenever I ...
2
votes
1answer
169 views

Micro MVC framework

I'm building my own micro MVC framework with only the absolute core functionality. My router will call the controller depending on the request method (GET or POST), and if the called action isn't ...
3
votes
1answer
228 views

Routing the CMS way

I always been curious on how to build great application with proper routing to my controllers, but after seeing some sources of applications like Xenforo, Joomla, it seems completely different, and ...
3
votes
1answer
572 views

Router for MVC framework

The class routes URLs based on the domain.com/class/method/param/.. format. It also checks the request type (GET or POST) and calls the method name GET or POST from ...
5
votes
1answer
175 views

Preprocessing Markdown Documents for Keywords

I recently added a feature to my application to serve arbitrary markdown documents from a directory. This is designed to allow authors to populate a folder full of help documents, and be able to view ...
4
votes
2answers
94 views

Routes for reminders

I have a controller with just a few actions, not the whole 7 RESTful actions situation. Here's what I have so far for routing: ...