Quantcast
Channel: Joomla! Forum - community, help and support
Viewing all articles
Browse latest Browse all 1854

Joomla! 4.x Coding • Add new Joomla 4 user via api

$
0
0
I'm trying to figure out how to add a new user via the API. I have created a module that seems to run successfully. Now I need help figuring out how to define the user object, what parameters are required, and how to save the object so it creates the user.

I've been studying the documentation and have figured out how to access the current user details: https://docs.joomla.org/Accessing_the_c ... save.28.29

That page says the same format should work to insert a new user record: "The only difference being that you don't load an existing record from the database first."

Since I don't load an object I need to create it. But I can't find an example, despite extensive searches.

It seems to say I would use code like this to save the new user after it is defined: $user->save();

My tests do include: use Joomla\CMS\Factory;

Thanks for any help.

Statistics: Posted by dave1webb — Tue Feb 06, 2024 5:10 am



Viewing all articles
Browse latest Browse all 1854

Trending Articles





<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>