PHPackages                             nighttraveler7/xmlpage - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. nighttraveler7/xmlpage

ActiveLibrary

nighttraveler7/xmlpage
======================

v1.0.7(6y ago)05MITPHP

Since Nov 11Pushed 6y ago1 watchersCompare

[ Source](https://github.com/nighttraveler7/xmlpage)[ Packagist](https://packagist.org/packages/nighttraveler7/xmlpage)[ RSS](/packages/nighttraveler7-xmlpage/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (9)Used By (0)

PHP Page Commonization System
=============================

[](#php-page-commonization-system)

Other Languages
---------------

[](#other-languages)

- このドキュメントの日本語版は README-ja.md です。
- To read this document in English, please continue reading.

Description
-----------

[](#description)

You can summarize your duplicated code on multiple files to one file using this library.
Different parts can be written in XML.

Requirements
------------

[](#requirements)

- Web server
- PHP 7.3 or later
- SimpleXML Extension
- Composer

Installation
------------

[](#installation)

Type the following command on your shell:

```
composer require nighttraveler7/xmlpage && composer install
```

Mechanism
---------

[](#mechanism)

1. The client requests the first PHP file.
2. On the serverside, the PHP program creates instance of the template engine class.
3. The program calls load\_template method of the instance.
4. The template engine loads the template file.
5. The template loads the XML file.
6. The template engine echos the parsed content to the client.

Usage
-----

[](#usage)

- This is a content of the XML file on xmlpages directory. (Default path: "/xmlpages/&lt;PAGE\_BASENAME\_WITHOUT\_EXT&gt;.xml" on your document root)

    ```

    	Helloworld
    	Hello world!]]>

    ```
- This is a content of the first requested PHP file by client.

    ```
