/** * Sign up the user:user /base/test/demo * Sign up the admin:admin /base/test/demo/admin */ public function demoAction() { $username = $this->dispatcher->getParam('param', null, 'user'); $user = new UserService(); // Skip rules $user->setRules([], false); $create = $user->signup(['username' => $username, 'password' => $username, 'repeatPassword' => $username, 'email' => $username . '@example.com', 'repeatEmail' => $username . '@example.com']); $activation = $user->addRole(); $this->view->setContent($this->dump->vars($create, $activation)); }