Welcome Guest, Not a member yet? Register   Sign In
Shield - what is the workflow for adding new users from an admin section?
#9

(This post was last modified: 09-04-2023, 05:04 AM by datamweb.)

So you don't need to define variable $newData.
PHP Code:
$newData = [
// ...
 
'full_name' => $this->request->getPost('full_name'),
 ]; 

You can proceed as follows:

PHP Code:
$users model('UserModel');
$user = new User([
    'username' => 'foo-bar',
    'email'    => '[email protected]',
    'password' => 'secret plain text password',
    'full_name' => $this->request->getPost('full_name'),
]);
$users->save($user); 
Reply


Messages In This Thread
RE: Shield - what is the workflow for adding new users from an admin section? - by datamweb - 09-04-2023, 05:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB