The t3lib_div package in TYPO3 provides a range of utility functions and classes for common tasks. One of the functions in this library is getUserObj(), which returns the current user object.
Here are some example code snippets that use getUserObj():
Example 1: $userObj = t3lib_div::getUserObj(); $userId = $userObj->user['uid'];
In this example, we are getting the current user object and then extracting the user ID from it. We can then use this ID to do things like checking permissions or fetching user data from the database.
Example 2: if(t3lib_div::getUserObj()->isAdmin()) { // do something only for admins }
Here, we are using getUserObj() to check if the current user is an admin. If they are, we can execute some code that is only meant for administrators.
The package library for t3lib_div is "TYPO3 Core". This library is included with TYPO3 by default and provides a wide range of utility functions and classes for building TYPO3 extensions and applications. The getUserObj() function is just one of many useful tools in this package, and it can be used to get information about the current user and their permissions in TYPO3.
PHP t3lib_div::getUserObj - 30 examples found. These are the top rated real world PHP examples of t3lib_div::getUserObj extracted from open source projects. You can rate examples to help us improve the quality of examples.