Jump to content

Creating custom template user using API


Ivan Gretsky
 Share

Recommended Posts

I am using this wonderfull feature to create users with different templates and under different parents. Now I need to do it via API. Looking at the source code it seems like I can easilly create a user with alternative template. But is there a way to specify parent page?

Certainly I can get still just create the users as pages like here, but that does not read as well and does not allow me to use addRole().

Link to comment
Share on other sites

Sometimes you need to spoil your forum karma to get your head working as it should)

My opinion: "it doesn't spoil your carma. You just show you're not afraid to be 'ignorant' in the open. That is a state where you show the others: 'I want to learn' and that is quite a strong one.

---

The reason it just works is just that User is extending Page, so User is a page with a few extra methods and stuff.

  • Like 2
Link to comment
Share on other sites

The reason it just works is just that User is extending Page, so User is a page with a few extra methods and stuff.

Yep, that's clear to me now. Thanks to PW I know some OOP. But I was confused by User constructor accepting template as parameter, but not accepting parent.

  • Like 1
Link to comment
Share on other sites

Yep, that's clear to me now. Thanks to PW I know some OOP. But I was confused by User constructor accepting template as parameter, but not accepting parent.

I didn't even know PHP could actually look like that. First time I was like, "what the heck with all those arrows?".

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...