znframework/package-xml

ZN Framework XML Package

7.0.3 2022-06-23 12:13 UTC

This package is auto-updated.

Last update: 2024-04-23 16:01:27 UTC


README

68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7a6e6672616d65776f726b2f7061636b6167652d786d6c3f7374796c653d666c61742d737175617265 68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f7a6e6672616d65776f726b2f7061636b6167652d786d6c3f7374796c653d666c61742d73717561726526636f6c6f723d303042464646 68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652d646174652f7a6e6672616d65776f726b2f7061636b6167652d786d6c3f7374796c653d666c61742d737175617265 68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7a6e6672616d65776f726b2f7061636b6167652d786d6c3f7374796c653d666c61742d737175617265

ZN Framework XML Package

Follow the steps below for installation and use.

Installation

You only need to run the following code for the installation.

composer require znframework/package-xml

Documentation

Click for documentation of your library.

Example Usage

Basic level usage is shown below.

<?php require 'vendor/autoload.php';

ZN\ZN::run();

$data = XML::build
([  
    'name'  => 'media', 
    'attr'  => ['id' => 1], 
    'child' => 
    [ 
        ['name' => 'video', 'attr' => ['id' => 2], 'content' => 'Vidyo'], 
        [
            'name'  => 'music', 
            'attr'  => ['id' => 3], 
            'child' => 
            [ 
                ['name' => 'video', 'attr' => ['id' => 2], 'content' => 'Vidyo'], 
                ['name' => 'video', 'attr' => ['id' => 2], 'content' => 'Vidyo'], 
                ['name' => 'video', 'attr' => ['id' => 2], 'content' => 'Vidyo'] 
            ]
        ]
    ]
]);

Output::display($data);
<?xml version="1.0" encoding="UTF-8"?>
<media id="1">
	<video id="2">Vidyo</video>
	<music id="3">
		<video id="2">Vidyo</video>
		<video id="2">Vidyo</video>
		<video id="2">Vidyo</video>
	</music>
</media>