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
58 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 ...
4
votes
0answers
30 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 ...
4
votes
0answers
39 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
1answer
26 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
76 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
65 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
68 views

Dissecting URLs

For the request object in my PHP application, I need to dissect the URL and assign its components to my class attributes (module, controller, method and the rest are parameters). Currently, I'm doing ...
1
vote
1answer
29 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
41 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
205 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), ...
2
votes
0answers
453 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
92 views

MVC router class performance

Can you review my code? ...
0
votes
1answer
78 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
130 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
107 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
71 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
350 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. ...
4
votes
1answer
924 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
512 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: ...
2
votes
1answer
128 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
139 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: ...
4
votes
2answers
815 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
91 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
123 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
140 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
394 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
124 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 ...
5
votes
1answer
266 views

MVC4 Routes, using Default

Should I leave the Default Route in if it's not adding any benefit? I have a RouteConfig.cs file that looks like this: ...
5
votes
1answer
1k views

PHP router class

I'm writing yet another MVC framework just for learning purposes and I would like you to review my code. Whenever I'm coding, I have that feeling that my code is horrible and is not the most efficient ...
1
vote
1answer
878 views

Backbone Router

I am thinking of writing some online notes/book. Amongst other things, I want to use Backbone to show different sections within a chapter as separate views. In other words, I want each chapter to ...
2
votes
1answer
199 views

Basic login with router

It's not finished yet, but I want to know if the structure and the classes are ok and what can I change. Feel free to say anything. To be more specific, I want to know what you think about the ...
2
votes
1answer
46 views

Nested routes and proper place for a function?

I have a Rails app and in it I have two models, widget and votes. Votes are used to keep track of the desirability of a widget. In my models I have: ...
3
votes
1answer
2k views

PHP MVC - Custom Routing Mechanism

Note #2: This was a post from a while back. Although the top rated answer is useful (generally), I'm looking for something more specific to this issue including routing / architecture. I've even ...
2
votes
1answer
2k views

Router Class In a Lightweight MVC Boilerplate

I'm trying to come up with a simple router class. I considered using a Request class, but I think that will turn something simple into something overly complex. ...
1
vote
2answers
269 views

MVC application class

Please could you review and critic my code and logic? Is this is along the right lines of an MVC application class or not? ...
3
votes
1answer
271 views

Breakable MVC framework written in PHP

I've written a framework in MVC. I call it Midget MVC, as it's so darn small. The reason I wrote it is because I wanted a lightweight and extensible framework to use in projects. It eventually got ...
1
vote
1answer
172 views

Trying to understand appropriate routing in MVC

I am learning MVC, and trying to understand routing. I understand that if I want to show an individual blog post for site.com/54, my route would be something like ...
2
votes
1answer
458 views

Routing, Navigation and State in MVC

I am attempting to refactor my app using the MVC paradigm. My site displays charts. The URLs are of the form app.com/category1/chart1 ...
2
votes
1answer
1k views

Good, flexible and secure MVC router PHP

I have developed a new router after having learnt a lot from my previous attempts and I will be using this in sites I make from now on. In a previous question, the issue of ...
2
votes
1answer
309 views

Improving my PHP autoloader

I'd like to improve my router. This is the current code for my autoloading action within my MVC application: ...
2
votes
1answer
769 views

Small routing system

I've written a small routing system in PHP but I'm not sure if it's done the right way and what changes can they be done to the code and improvements. ...
2
votes
2answers
998 views

A PHP MVC working with Mustache (and now nested templates!)

I'd love some feedback about this code that I'm editing and shortening now. ...
5
votes
1answer
1k views

The Router - dispatch after parseURL

I'm hoping that the more experienced devs here can help me improve these methods. I'm building a basic MVC framework for myself (as a learning project,) and I'd really appreciate your insights. Things ...
0
votes
4answers
1k views

Structuring code to do URL routing for Node.js [closed]

What would be the best (performance, memory wise) to achieve a clean way to create a class or some way to properly structure the code, that shares 2 variables (req, res) which have a decent object ...
4
votes
1answer
4k views

Routing in MVC with PHP

I am in the progress of creating a MVC structured website. I've opted to make my own instead of using pre-constructed MVC systems as a way to teach myself better coding and understanding how ...
3
votes
1answer
655 views

Zend Framework getAction method

I am new to MVC and Zend, so I have little idea what I am doing at the moment, but here is my question. The following code is my get method for an API I am attempting to build in order to learn both. ...
3
votes
4answers
383 views

Setting controller, action, and values based on the number of URL chunks

Is there any way to improve this code? It looks a bit ugly for me. ...
4
votes
2answers
2k views

Object Oriented PHP Url Router

I just finished rewriting my Router class. Any input would be much appreciated. The class routes URLs based on a site.com/class/method/param/param/etc syntax. One ...
4
votes
2answers
893 views

Framework to drive a small personal site

I have been writing a very slim MVC framework to drive a small personal website. It's nothing intricate, just mostly for fun and a learning experience. Specifically, this is the initial part of the ...
6
votes
2answers
268 views

Dispatcher for a JSON API without routes

I am using this code for a fast JSON API without routes. Does this code contain any useless parts? Is the class loader efficient enough? Are there any better options? Is ...