Termwind构建 PHP 命令行应用程序

联合创作 · 2023-09-28 10:04

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()
])
);
}
}

浏览 31
点赞
评论
收藏
分享

手机扫一扫分享

编辑 分享
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑 分享
举报