Questions tagged [front-controller]

The Front Controller Pattern provides a centralized entry point for handling requests in web applications.

Front controllers are often used in web applications to implement workflows. While not strictly required, it is much easier to control navigation across a set of related pages (for instance, multiple pages might be used in an online purchase) from a front controller than it is to make the individual pages responsible for navigation.

144 questions
4
votes
3 answers

Zend framework: Removing default routes

I'm using Zend FW 1.9.2, want to disable the default routes and supply my own. I really dislike the default /:controller/:action routing. The idea is to inject routes at init, and when the request cannot be routed to one of the injected routes it…
Maurice
  • 4,829
  • 7
  • 41
  • 50
4
votes
2 answers

A lightweight PHP frameworks that provides HTTP router and Access Control

As you know some well-known PHP frameworks have provide front-controller pattern and access control mechanism. Also there are some micro framework that provide front-controller pattern. I have surveyed some such frameworks and yet could not make a…
Handsome Nerd
  • 17,114
  • 22
  • 95
  • 173
4
votes
3 answers

Routing URL Path with PHP and Apache

I am trying to create a nice url structure for my site. My router class will only work if the url is in the style of ?something=value. How do I get it so it will work like: /something/value In my .htaccess I have: Options…
imperium2335
  • 23,402
  • 38
  • 111
  • 190
4
votes
3 answers

Where should autloader go in MVC?

I'm trying to build a simple MVC framework to better understand certain concepts. The first thing that I thought would be important to address is a front controller that handles all of the requests for my applications. Once I started to think about…
ohiock
  • 646
  • 3
  • 7
  • 22
4
votes
2 answers

java.lang.NoSuchMethodException with Constructor newInstance

I am currently working on some web dev project in Java, i have implemented a frontcontroller, which job is to instantiate new controllers, depending on the path. So when the user is running ?q=user/login ex. the front controller should instatiate…
MartinElvar
  • 5,695
  • 6
  • 39
  • 56
3
votes
2 answers

Efficient forwarding HTTP requests with an IHttpAsyncHandler

I'm developing a HTTP front controller, based on the pattern of Martin Fowler (link). In my case the controller has the following responsibilities: - Unmarshall encapsulated data - Authorize the request - Logging - Relay / forward the request to…
Niels Bergsma
  • 77
  • 1
  • 7
3
votes
2 answers

Is it possible to use a "front controller" in Rails?

In Spring MVC a Dispatcher servlet is used as a "front controller" to handle all of the application requests and route them appropriately. Is it possible to use such an approach in Rails or is it required to write a separate controller for each…
pez_dispenser
  • 4,394
  • 7
  • 37
  • 47
3
votes
2 answers

How the Spring MVC @Controller's handler methods' parameters are automatically resolved during run-time?

How does the DispatcherServlet (or any other bean, supporting Spring MVC infrastructure), dynamically, resolve the signature of the handler method of the @Component instance, and how does it know, what parameters/types are expected, in which order,…
Giorgi Tsiklauri
  • 9,715
  • 8
  • 45
  • 66
3
votes
1 answer

how to leverage on Spring MVC to implement front controller but not using controllers

the title of this post might be confusing.I'll try be best to clarify it. I Started a project using Spring MVC it works fine no problem.After that i've realized that i was a bit overkill and found that i needed a front controller dispatcher…
black sensei
  • 6,528
  • 22
  • 109
  • 188
3
votes
3 answers

Getting View Object from within a Zend Controller plugin

In my controller, I have a postDispatch to consolidate my FlashMessenger messages: public function postDispatch() { $messages = $this->_helper->getHelper ( 'FlashMessenger' ) ->getMessages (); if ( $this->_helper->getHelper (…
Corey
  • 1,977
  • 4
  • 28
  • 42
3
votes
2 answers

Zend_Framework- Where to Place $_GET and $_POST (HTTP Request) handling?

I recently read this post which led to a series of other posts that all seem to suggest the same idea: Models do everything, the View should be able to communicate directly with the model and vice versa all while the Controller stays out of the way.…
3
votes
2 answers

Pretty URL to string parameters

I have a website that use this style : /index.php?page=45&info=whatever&anotherparam=2 I plan to have pretty url to transform the previous url to : /profile/whatever/2 I know I have to use .htAccess and to redirect everything to index.php. That's…
Patrick Desjardins
  • 136,852
  • 88
  • 292
  • 341
3
votes
7 answers

How to implement URL pattern interpreter as used by Django and RoR in PHP

What's the best way to implement a URL interpreter / dispatcher, such as found in Django and RoR, in PHP? It should be able to interpret a query string as follows: /users/show/4 maps to area = Users action = show Id = 4 /contents/list/20/10 maps…
Jrgns
  • 24,699
  • 18
  • 71
  • 77
3
votes
3 answers

PHP Front Controller with MVC

I am trying to delve into MVC with Front Controller Design. I want to invoke my entire application by using one line, for example in index.php: require_once(myclass.php); $output = new myClass(); I would love to get rid of the require_once line,…
Chud37
  • 4,907
  • 13
  • 64
  • 116
3
votes
2 answers

PHP Matching URI to Pattern

I am working on a simple front controller, mainly for learning purposes. I like the way Symfony does routing, having patterns in your map like this: /news/{category}/{id} and passing category and id variables to the controller. But my problem is…
szab.kel
  • 2,356
  • 5
  • 40
  • 74
1
2
3
9 10