-- Shekar C Reddy <[EMAIL PROTECTED]> wrote
(on Wednesday, 21 March 2007, 06:00 AM -0400):
> 1. There is no method to unset a param in action controller or its request
> class. We need a unsetParam() method in action/request.

You can always pass a null to setParam():

    $this->setParam('someKey', null);

The controller parameters are not really intended to be a general
purpose storage mechanism; they're primarily for pushing values and
objects from the front controller down through the controller chain
(router, dispatcher, action controllers). I personally feel that
if you're needing something like that, use a Zend_Config object in
read/write mode and push it in either the registry or as a controller
param.

> 2. I see usage of getRequest() and getResponse() methods inside the
> action class although these vars are sitting right inside the class
> itself (protected $_request, $_response) that can be accessed directly
> instead of invoking a method to access them. Accessing them directly
> inside the action class should improve performance.

This is true. However, the accessors are there for cases where the
developer may want to wrap some logic around retrieving these objects --
perhaps grabbing them from a registry, for instance. That said, when I
know that there's no such logic in classes I'm using, I access them
directly from the class properties.

-- 
Matthew Weier O'Phinney
PHP Developer            | [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/

Reply via email to