marshaller:[已弃用] 从一种格式转换为另一种格式的 PHP 库

时间:2021-06-02 21:57:13
【文件属性】:
文件名称:marshaller:[已弃用] 从一种格式转换为另一种格式的 PHP 库
文件大小:14KB
文件格式:ZIP
更新时间:2021-06-02 21:57:13
PHP 马歇尔 从一种格式转换为另一种格式的 PHP 库。 Marshaller 不会尝试猜测如何转换给定的输入,而是依赖于开发人员实现的MarshallerStrategies :它让我们可以完全控制输出格式。 要将输入自动转换为特定格式(例如 XML、JSON 或 YAML),最好使用其他工具(例如 )。 安装 Marshaller 可以使用安装: composer require "gnugat/marshaller:~2.0" 简单转换 让我们以以下对象为例: <?php class Article { public function __construct ( $ title , $ content ) { $ this -> title = $ title ; $ this -> content = $ content ;

网友评论