<?php

/**
 * @var string $name
 */
call_component('http://e1stuff.com/components/test/e1', 'Hello-World', ['id' => 'hello', 'title' => 'Greetings ' . $name . '!', '_content' => '']);
?>

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>PHP X Components</title>
</head>
<body>
<!-- Hello -->
<?php 
call_component('http://e1stuff.com/components/test/e1', 'Hello-World', ['_content' => new \PhpXComponents\Util\StringClosure(function () {
    ?>

    <?php 
    echo htmlentities(isset($_GET['name']) ? $_GET['name'] : 'Mr. X', ENT_QUOTES, 'UTF-8', false);
})]);
?>

</body>
</html>
<?php

/**
 * @var string $name
 */
call_component('http://e1stuff.com/components/test/e1', 'Hello-World', ['id' => 'hello', 'title' => 'Greetings ' . $name . '!', '_content' => new \PhpXComponents\Util\StringClosure(function () use($name) {
    ?>
Hello <?php 
    echo $name;
    ?>
!<?php 
})]);
?>

<?php

call_component('http://e1stuff.com/components/test/e1', 'Hello-World', ['id' => 'hello', 'title' => 'Greetings!', '_content' => new \PhpXComponents\Util\StringClosure(function () {
    ?>
Hello World!<?php 
})]);
?>