/** * View active users. * * @return void */ public function activeAction() { // Get a handle to a question object $question = new \Bjurnemark\Question\Question(); $question->setDI($this->di); // Get the ids of the most active users $userIds = $question->getActiveUsers(); $data = array(); // Fetch each user and add the gravatar image foreach ($userIds as $id) { $this->user->find($id); $gravatar = $this->user->getGravatar(60); $this->user->image = "<img class='login-logo' src='{$gravatar}' alt='account'/>"; // Clone user (otherwise passed by reference) $data[] = clone $this->user; } $this->views->add('user/list', ['data' => $data, 'title' => "Frågvisaste användarna"]); }