문제

I am writing a custom Component in Joomla 3.x.

At a certain point of the component I need to create a Custom User Group under 'Registered' group in Joomla.

After searching the web a lot, I found no solution of this problem.

도움이 되었습니까?

해결책

You can add it to the #__usergroups table programmatically, ensuring the user group is not there already; or get an instance of JTableUsergroup (declared in libraries/joomla/table/usergroup.php). Since it extends JTable you can use its save() method, passing an array with the values you wish to store.

Then in order to have proper lft and rgt values, you need to invoke the rebuild() method on JTableUsergroup.

Please ensure adding it programmatically is really necessary, it may cause issues on sites that already make heavy use of usergroups.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top