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
2
votes
2 answers

Avoid large switch statement in frontcontroller

I have a larger application with a Frontcontroller in php that handles incoming ajax requests. I am thinking about a good way to handle Action->Method mapping, this controller is in charge of instantiating other classes and executing methods…
neph
  • 733
  • 1
  • 8
  • 16
2
votes
2 answers

Zend clear Request Parameters

I just wanted to ask why the following inside a Zend_Controller_Action action method: $request = $this->getRequest(); $params = $request->getParams(); var_dump($params); foreach ($params as $key => &$value) { $value =…
krzysiek
  • 465
  • 5
  • 16
2
votes
0 answers

How can i get the exclude url in decorator.xml of sitemesh

I use sitemesh to decorate my application.And config a decorator.xml as follow to make some url not decorated by sitemesh.
yonney.yang
  • 135
  • 8
2
votes
2 answers

Magento - How to extend Front Controller

I am need of making a change to the Magento function _checkBaseUrl found within: app/code/core/Mage/Core/Controller/Varien/Front.php As best practice I am trying to extend it with my own module so I am not editing the core code and files but it is…
odd_duck
  • 3,941
  • 7
  • 43
  • 85
2
votes
1 answer

How to handle subdirectories in a Front Controller pattern

TL;DR: My URL rewriting breaks if a subdirectory without a file is requested. Instead of loading a default home page as expected, I'm getting a 403 Forbidden error. I'm using Apache URL rewriting to build a site using the Front Controller pattern.…
2
votes
0 answers

Single Front Controller for Multiple .Net MVC Web Projects in same Solution

I have a solution that contains two web projects (one Admin and one Public) as well as a number of class libraries. I have a front controller placed in the Admin project that gets invoked for every web request. My problem is that none of the…
2
votes
1 answer

Which element in a web app should be responsible for loading applicationscoped data?

Consider a web application, constructed from the Front Controller design pattern, included the strategy-pattern based actions, .jsp pages, javabeans and database connection, like the picture below: How do I assign responsibilities in my code, for…
jumps4fun
  • 3,994
  • 10
  • 50
  • 96
2
votes
4 answers

How do I implement a front controller in Java?

I'm writing a very simple web framework using Java servlets for learning purposes. I've done this before in PHP, and it worked by consulting the request URI, then instantiating the appropriate class and method. This worked fine in PHP, as one can do…
etheros
  • 2,733
  • 2
  • 24
  • 25
2
votes
1 answer

Java Servlets - Front Controller Questions (Listeners & Context)

For the current project I'm working on, I've decided to use the front controller pattern. I've always been under the impression that a front controller should (ultimately) be responsible for everything that happens in a web app. Would listeners…
2
votes
1 answer

MVC with a front controller confusion

** simplified question ** I am learning oop patterns and I am looking to build my own simple mvc framework. I would like this to have a front controller but I am finding it difficult to find any credible information for implementing a front…
Michael Ramirez
  • 237
  • 5
  • 21
2
votes
3 answers

How can I override FrontController in prestashop 1.5?

I know there are similar questions, but none of them can solve my problem. I placed a FrontController.php file in /override/classes/controller/ It contains this code: Class FrontController extends FrontControllerCore{ public function…
Luca Reghellin
  • 7,426
  • 12
  • 73
  • 118
2
votes
1 answer

Security of URL class/method routing

Are their any security issues regarding the use of class names and/or parameters in the url? I have created a simple PHP page router that routes paths, for example: www.mysite.com/classname/methodname/param1/param2/etc/etc Are there any dangers in…
imperium2335
  • 23,402
  • 38
  • 111
  • 190
2
votes
3 answers

Javascript Login Page with PHP authentication script- Which implementation is Best?

I wrote a working php authentication script for my HTTP file Server. Now, I want to write a login page with some nice graphics. I usually write my pages in HTML5, javacscript, and CSS. I am not sure how to implement the php authentication script. So…
dman
  • 10,406
  • 18
  • 102
  • 201
1
vote
1 answer

Using set_exception_handler to handle errors in an application

I am currently working on an MVC application that implements the front-controller pattern. The process works like this: request is received request gets turned into a RequestObject RequestObject is passed to the dispatcher Dispatcher then routes…
F21
  • 32,163
  • 26
  • 99
  • 170
1
vote
4 answers

PHP layout manager

I am not sure if I am allowed to ask a more practical question here as this question is not as much support as just giving good advice. I have a front controller with a simple layout manager (lack of a better term) which effectively loads a default…
mauzilla
  • 3,574
  • 10
  • 50
  • 86
1 2
3
9 10