I have problem to return callable function written as php string.
On server side I have:
return = [
    'options' => [
        'timeout' => 3000,
        'callback' => [
            'close' => 'function(){
                alert("Test");
            }'
        ]
    ],
]
In my view model:
<?php echo '<script type="text/javascript">$.jQueryPlugin.defaults = '.json_encode($arrayFromAbove).'</script>';?>
But it does not work since callback is returned as string not callable js function.
Any advise how can I convert string as callable js function?
 
     
    