[pLog-general] get request from view?

Su Baochen subaochen at 126.com
Sun Mar 6 00:38:14 GMT 2005


hi,

Request object is usually used to get url parameters, and I noticed that
I Action.class.php, there is a _request member variable to help to get
url parameters.

But sometimes we need to get url parmeters from view, not from action.
At this time, we can use the second parameter(an array) of view class to
transfer the needed parameters from action object to view object. For
example:

$view = new TestView("templateName",Array("param1"=>"value"));

But how about get url parameters from view directly? how about also add
memeber value _request to base view class? 

class View{
  ...
  var $_request;
  function View(){
    ...
    $this->_request = new Request(HttpVars::getRequest());
  }
} 

Best regards,

Su Baochen





More information about the pLog-general mailing list