abdfahim
Well-known member
I have created a new page "accounts/test-fields" to house all the custom fields with new type "test_fields".
But I am not sure how to save the changes of the new page, i.e. write the function testFieldsSaveProcess(). I tried to understand and mimic the XF function accountDetailsSaveProcess(), but miserably failed in both cases.
But I am not sure how to save the changes of the new page, i.e. write the function testFieldsSaveProcess(). I tried to understand and mimic the XF function accountDetailsSaveProcess(), but miserably failed in both cases.
Code:
namespace AbdFahim\XF\Pub\Controller;
class Account extends XFCP_Account
{
public function actionTestFields()
{
if ($this->isPost())
{
$visitor = \XF::visitor();
if ($visitor->canEditProfile())
{
$this->testFieldsSaveProcess($visitor)->run();
}
return $this->redirect($this->buildLink('account/test-fields'));
}
else
{
$view = $this->view('XF:Account\TestFields', 'test_fields');
return $this->addAccountWrapperParams($view, 'test_fields');
}
}
protected function testFieldsSaveProcess(\XF\Entity\User $visitor)
{
}
}
Last edited: