• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Coding to pull latest member name?

Smooth

Active member
#1
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
#2
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);
    }