Termwind构建 PHP 命令行应用程序
Termwind 允许你使用 Tailwind CSS API 构建独特而漂亮的 PHP 命令行应用程序。简而言之,它就像 Tailwind CSS,但适用于 PHP 命令行应用程序。
use function Termwind\{render};
// single line html...
render('<div class="p-1 bg-green-300">Termwind</div>');
// multi-line html...
render(<<<'HTML'
<div>
<div class="p-1 bg-green-300">Termwind</div>
<em class="ml-1">
Give your CLI apps a unique look
</em>
</div>
HTML);
// Laravel or Symfony console commands...
class UsersCommand extends Command
{
public function handle()
{
render(
view('users.index', [
'users' => User::all()
])
);
}
}
评论
