stefanfisk/vy 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

stefanfisk/vy

最新稳定版本:v1.0.0-beta.9

Composer 安装命令:

composer require stefanfisk/vy

包简介

A simple view library inspired by React.

README 文档

README

A simple view library inspired by React.

Source Code Download Package PHP Programming Language Read License Build Status Codecov Code Coverage Psalm Type Coverage

About

Installation

Install this package as a dependency using Composer.

composer require stefanfisk/vy

Usage

Below is a minimal example. Check out the examples for more.

namespace StefanFisk\Vy\Example;

use StefanFisk\Vy\Serialization\Html\UnsafeHtml;
use StefanFisk\Vy\Vy;

use function StefanFisk\Vy\el;

class MyPage
{
    public static function el(string $title): Element
    {
        return Element::create(self::render(...), [
            'title' => $title,
        ]);
    }

    private static function render(string $title, mixed $children = null): mixed
    {
        return [
            UnsafeHtml::from('<!DOCTYPE html>'),
            html::el(lang: 'en')(
                head::el()(
                    meta::el(charset: 'UTF-8'),
                    title::el()($title),
                ),
                body::el()(
                    $children,
                ),
            ),
        ];
    }
}

$el = MyPage::el(
    title: 'Hello, world!',
)(
    h1::el()(
        'Hello, world!',
    ),
    p::el()(
        'This is a test page. There are many like it, but this one is mine.',
    ),
);

$vy = new Vy();

echo $vy->render($el);

Contributing

Contributions are welcome! To contribute, please familiarize yourself with CONTRIBUTING.md.

Coordinated Disclosure

Keeping user information safe and secure is a top priority, and we welcome the contribution of external security researchers. If you believe you've found a security issue in software that is maintained in this repository, please read SECURITY.md for instructions on submitting a vulnerability report.

Copyright and License

stefanfisk/vy is copyright © Stefan Fisk and licensed for use under the terms of the MIT License (MIT). Please see LICENSE for more information.

统计信息

  • 总下载量: 911
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: HTML

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-08-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固