public function execute(ResponseInterface $response) : ResponseInterface { $this->presentation->define('page-title', 'User Search'); $users = []; foreach ($this->model->search() as $value) { $users[] = $value['username']; } $this->presentation->assign('items', $users); $this->presentation->assign('term', $this->model->criteria()); $response->content()->write($this->presentation->render('users/search')); return $response; }
/** * Executes the view * * @return mixed */ public function execute() { $this->template->define('page-title', 'Homepage'); $this->template->assign('username', 'Administrator'); return $this->template->render('tests/child.phtml'); }