<div>
<Thumbnail blog="$blog" />
<a href="{$blog->url}">
<h3>{$blog->title}</h3>
<p>{$blog->description}</p>
</a>
<LikeButton liked="{$blog->favorite}" (click)="like" />
</div>class Blog extends BaseComponent
{
public BlogModel $blog;
public function like()
{
$this->blog->favorite = !$this->blog->favorite;
}
}Discover more at https://viewi.net.
PHP functions in the browser: every PHP function a component can call, and how closely its browser version matches PHP.
VS Code extension: Viewi Components (source). Highlighting and autocomplete in templates, Go to Definition for components, props and global methods.
Urlicer is branded short links, QR codes, team workspaces and click analytics. It runs its entire frontend on Viewi: server-rendered PHP components hydrated in the browser, with no JavaScript framework. Built and maintained by Viewi's author.
Unit tests, including the PHP↔JS parity suite (needs node on the PATH):
composer test
All tests:
php vendor/bin/codecept run
Unit tests:
php vendor/bin/codecept run Unit
Specific test:
php vendor/bin/codecept run Unit JsTranspilerTest
After adding or changing a JS port in src/Viewi/PhpJsFunctions, add its cases to tests/Support/Data/parity/ and regenerate FUNCTIONS.md:
composer functions-doc
php vendor/bin/codecept generate:test Unit JsTranspiler
Viewi is built in our free time. If you like it, here is how you can help:
- Give us a star⭐.
- Follow us on X.
- Contribute by sending pull requests.
- Any other ideas or proposals? Please mail me contact@viewi.net.
- Feel welcome to share this project with your friends.
Copyright (c) 2020-present Ivan Voitovych
Please see MIT for license text