TheBigK
Well-known member
I need help in making this data writer work. Here's what I have.
The idea is to set both $department_name and corresponding $department_email at a time. I'm however constantly getting the following error -
Undefined offset: 1
PHP:
$department_name = $this->_input->filterSingle('department_name', XenForo_Input::STRING, array('array' => true));
$department_email = $this->_input->filterSingle('department_email', XenForo_Input::STRING, array('array' => true));
$dw = XenForo_DataWriter::create('ContactUs_DataWriter_Contact');
//The following approach, I think is wrong.
for ($i = 0; $i <= sizeof($department_name); $i++)
{
$dw->set('department_name', $department_name[$i]);
$dw->set('department_email', $department_email[$i]);
$dw->save();
}
Undefined offset: 1
- XenForo_Application::handlePhpError() in ContactUs/ControllerAdmin/Index.php at line 34
- ContactUs_ControllerAdmin_Index->actionAdd() in XenForo/FrontController.php at line 347
- XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
- XenForo_FrontController->run() in /Users/CE-Mac-Two/Sites/xf/admin.php at line 13