2021-12-14 09:48:09 +03:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @var string $attributes
|
|
|
|
*/
|
|
|
|
?>
|
|
|
|
<script <?= $attributes ?>>
|
2022-01-18 10:18:22 +03:00
|
|
|
window.vars = (function () {
|
|
|
|
const vars = <?= json_encode(script_vars()) ?>;
|
|
|
|
|
|
|
|
return (key) => {
|
|
|
|
if (!key) {
|
|
|
|
return vars;
|
|
|
|
}
|
|
|
|
|
|
|
|
return vars[key] || undefined;
|
|
|
|
};
|
|
|
|
})();
|
2021-12-14 09:48:09 +03:00
|
|
|
</script>
|
|
|
|
|