kohana - How do I pass parameters after setting the content of a template? -
my problem lose parameters (i.e. can't use id
variable) when inside if condition because occurs after press submit
button in view (i.e. after set post array)
public function action_resetpassword() { $this->template->content = view::factory('user/password/reset') ->bind('message', $message) ->bind('errors', $errors); if (http_request::post == $this->request->method()) { $id = $this->request->param('id');
if understand correctly wish pass parameters view set in if. can done 'binding' these variables view (i.e. pass reference)
public function action_resetpassword() { $this->template->content = view::factory('user/password/reset') ->bind('message', $message) ->bind('errors', $errors) ->bind('id', $id); // empty variable defined here ... if (http_request::post == $this->request->method()) { // ... , set here $id = $this->request->param('id');
inside view $id
have value of whatever comes request parameter.
if not mean, should read bit variable scope in php , question not related kohana
Comments
Post a Comment