Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Aleksey Zapparov's Blog:
How to handle unexistence controllers/actions with Zend_Controller
Oct 18, 2006 @ 15:56:00

As mentioned by the Zend Developer Zone in this post, Aleksey Zapparov has posted a quick tutorial on how to deal with a missing action and controller in your Zend Framework application.

You can easily make them call indexController::noRouteAction() on unexistence controllers, but on unexistence actions they'll throw you an exception. So there is a way to change this - modify sources.

His code basicly watches for the exceptions that would be thrown from a missing action and handles then inside a try/catch. If things fail, the user gets shuttled off to the Error404 controller that dumps out the contents of the controller class.

tagged: zend framework controller action nonexistence zend_controller error404 zend framework controller action nonexistence zend_controller error404

Link:

Aleksey Zapparov's Blog:
How to handle unexistence controllers/actions with Zend_Controller
Oct 18, 2006 @ 15:56:00

As mentioned by the Zend Developer Zone in this post, Aleksey Zapparov has posted a quick tutorial on how to deal with a missing action and controller in your Zend Framework application.

You can easily make them call indexController::noRouteAction() on unexistence controllers, but on unexistence actions they'll throw you an exception. So there is a way to change this - modify sources.

His code basicly watches for the exceptions that would be thrown from a missing action and handles then inside a try/catch. If things fail, the user gets shuttled off to the Error404 controller that dumps out the contents of the controller class.

tagged: zend framework controller action nonexistence zend_controller error404 zend framework controller action nonexistence zend_controller error404

Link:

Alexander Netkachev's Blog:
Using Zend_Controller in subfolder
Sep 27, 2006 @ 12:33:00

One of the most asked questions when it comes to using the Zend Framework is "how can I use it in a subfolder?" Everything behaves well when it's at the document root of the server it's on, but strange things start happening when it's anywhere below that. There's been server people that have posted solutions, and another can be added to them - this new post from Alexander Netkachev.

This question I had heard many times and now I have a few minutes to write down the answer so that everybody who stuck in the similar trouble could quickly resolve the issue. Who works with Zend Framework, most likely, have read the "Zend_Controller / Getting Started" Zend Framework manual article, which explains how to use Zend_Controller in the root folder of the web server. But it does not answer on the "How to run my Zend Framework application in a subfolder of the web server document folder?" question and I propose you my solutions.

First is rather a hack then a recommended solution, but with it you can start the applications and examples that use standard router. The second is neater but it depends on the Zend_Controller_RewriteRouter class.

The first method makes some changes to the default routing code itself (the hack) to make it no longer just use the REQUEST_URI, but to look at more of the URL to see if subdirectories exist. OF course, the more preferred way to go, and just as simple of an option, is using the framework itself to change the RewriteRouter options to allow for the subdirectory.

tagged: zend framework zend_controller rewriterouter router zend framework zend_controller rewriterouter router

Link:

Alexander Netkachev's Blog:
Using Zend_Controller in subfolder
Sep 27, 2006 @ 12:33:00

One of the most asked questions when it comes to using the Zend Framework is "how can I use it in a subfolder?" Everything behaves well when it's at the document root of the server it's on, but strange things start happening when it's anywhere below that. There's been server people that have posted solutions, and another can be added to them - this new post from Alexander Netkachev.

This question I had heard many times and now I have a few minutes to write down the answer so that everybody who stuck in the similar trouble could quickly resolve the issue. Who works with Zend Framework, most likely, have read the "Zend_Controller / Getting Started" Zend Framework manual article, which explains how to use Zend_Controller in the root folder of the web server. But it does not answer on the "How to run my Zend Framework application in a subfolder of the web server document folder?" question and I propose you my solutions.

First is rather a hack then a recommended solution, but with it you can start the applications and examples that use standard router. The second is neater but it depends on the Zend_Controller_RewriteRouter class.

The first method makes some changes to the default routing code itself (the hack) to make it no longer just use the REQUEST_URI, but to look at more of the URL to see if subdirectories exist. OF course, the more preferred way to go, and just as simple of an option, is using the framework itself to change the RewriteRouter options to allow for the subdirectory.

tagged: zend framework zend_controller rewriterouter router zend framework zend_controller rewriterouter router

Link:


Trending Topics: