$user


User Methods

$user->save()

Introduced in Version 2.0

Description

Save user to the database.

Creating a new user and saving to the database:

$item = new User();
$item->setOutputFormatting(false);
$item->name = $sanitizer->pageName("newname");
$item->pass = "yo12345";
$item->email = $sanitizer->email("example@processwire.com");
$item->addRole('guest');
$item->save();

Related

Post Comment