定制 apsxj/xml 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

apsxj/xml

Composer 安装命令:

composer require apsxj/xml

包简介

XML Parsing and Response Library

README 文档

README

XML Parsing and Response Library

Getting Started

  1. Add the following to your composer.json file:
  "require": {
    "apsxj/xml": "dev-main"
  },
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/apsxj/xml.git"
    }
  ]
  1. Run composer install

  2. Before calling any of the methods, require the vendor autoloader

// For example, from the root directory...
require_once(__DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php');
  1. To create an Response object and render it:
<?php

// unwrap classes from the apsxj\xml namespace
use apsxj\xml\Node;
use apsxj\xml\Doc;
use apsxj\xml\Response;

// Create the doctype declaration node
$doctype = Node::element(
  '!DOCTYPE',
  array(
    'html' => 'html'
  )
);

// Create the HTML node
$html = Node::element(
  'html',
  array(
    'lang' => 'en',
    'class' => 'h-100'
  ),
  array(
    Node::text('<head><title>It works!</title></head><body><h1>It works!</h1></body>')
  )
);

// Create the Document
$doc = new Doc($doctype, $html);

// Pass the document to a new Response object
$response = new Response($doc);

// Render the response
$response->render(200);

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 3
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-05-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固