* @author Wojciech Król * @copyright 2017 Paweł Klockiewicz, Wojciech Król * @license https://batflat.org/license * @link https://batflat.org */ namespace Inc\Modules\Users; use Inc\Core\SiteModule; class Site extends SiteModule { public function init() { $this->tpl->set('users', function () { $result = []; $users = $this->db('users')->select(['id', 'username', 'fullname', 'description', 'avatar', 'email'])->toArray(); foreach ($users as $key => $value) { $result[$value['id']] = $users[$key]; $result[$value['id']]['avatar'] = url('uploads/users/' . $value['avatar']); } return $result; }); } }