You can easily use Viewi as a template engine to render your view pages. Like this:
\Viewi\App::run(WelcomeNewUser::class, ['user' => $userModel])
Just call \Viewi\App::run with the name of your component, and optionally pass the data that will be injected into the component:
class WelcomeNewUser extends BaseComponent { public UserModel $user; public function __init(UserModel $user) { $this->user = $user; } }
And that’s it. You will have the string content in return.