[Solar-talk] request object

Jeff Surgeson solar at 3hex.com
Wed Sep 27 14:55:17 PDT 2006


Hi All

Am busy converting my projects to use the Solar_Request and wondered why the 
following.

In Solar_Controller_Page a request object in created in the constructor, 

$this->_request = Solar::factory('Solar_Request');

which is used and reffered to on a number of occasions in the Solar App's when 
access is needed to server/post/get requests.

However in Solar_Content_Abstract a new request object is created each time 
access is needed to a server request, for example,

$request = Solar::factory('Solar_Request')
$data['editor_ipaddr'] = $request->server('REMOTE_ADDR');

Would it not be simpler to create the request object once in the constructor 
as is done in Solar_Controller_Page and just refer to it when needed as 
apposed to creating a new object each time?

Or is this a case of six of one, or am I missing the plot as usual. ;-)

Regards
-- 
Jeff Surgeson / South Africa


More information about the solar-talk mailing list