Coding to pull latest member name?

Smooth

Active member
Hey all :)

Is there a code to pull the latest members username?

We would like to put a notice on our homepage to welcome the latest newcomer.

Many thanks :)
 
R

ragtek

Guest
The user model provides a method for this
PHP:
    /**
     * Fetch the most recently-registered users
     *
     * @param array $criteria
     * @param array $fetchOptions
     *
     * @return array User records
     */
    public function getLatestUsers(array $criteria, array $fetchOptions = array())
    {
        $fetchOptions['order'] = 'register_date';
        $fetchOptions['direction'] = 'desc';

        return $this->getUsers($criteria, $fetchOptions);
    }
 

Smooth

Active member
Thank you! :)

Is there a way to pull this coding into a normal post rather than template?

Not to worry if not :)
 
Top