This site is built with Viewi itself. It is experimental and still in development. If you see any bugs please do not hesitate and open an issue or DM me on Twitter.

Using as Template Engine

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.