request
class uses $_REQUEST
by default to get values, so you need to set $_POST
if you need, like
Code: Select all
$myvar = $request->variable('myvar', true, \phpbb\request\request_interface::POST);
You can do it like thateeji wrote:can I get the whole $_POST array?
Code: Select all
$post_vars_array = $request->variable_names(\phpbb\request\request_interface::POST);
$request->variable();
.So if you are posting 12 different fields with various types, you have to request_var for each of them?rxu wrote: ↑Mon Sep 28, 2015 1:52 pmYou can do it like thateeji wrote:can I get the whole $_POST array?This way you'll get an array with the $_POST variable names which can be used to get their values viaCode: Select all
$post_vars_array = $request->variable_names(\phpbb\request\request_interface::POST);
$request->variable();
.
Code: Select all
$data = array(
'comp1' => $this->request->variable('comp1',0),
'comp2' => $this->request->variable('comp2',0),
'comp3' => $this->request->variable('comp3',0),
'comp4' => $this->request->variable('comp4',0),
'comp5' => $this->request->variable('comp5',0),
);