I have some views in ZF2 that must include js and css files. I can do so in view:
$this->headscript()->appendScript(...
But, when I get view result using ajax I need to get from server array with view html, css includes and js includes. Like this:
array(
'html' => '<div id="timepicker-wrap"></div>',
'js_include' => array('/js/timepicker.js'),
'js_eval' => '$("#timepicker-wrap").timepicker()',
'css_include' => array('/css/timepicker.css'),
);
After I give this data to client-side my js library will include html, js and css.
The problem is to get all js and css files and code from headscript in server-side.
Am I right that I have to extend HeadScript, HeadStyle and InlineScript classes and add functions that returns all js and css? Or I have to do something else?