Akelos will try to send the right headers after rendering all the templates, this makes not possible to emit the buffer before sending Response headers.
I'm not sure what is your use case, but you might have a look at the capture_helper
…in your view
<? $capture_helper->begin ('script'); ?>
alert('hello world');
<? $capture_helper->end (); ?>
and in your layout
<script type="text/javascript">
{content_for_script}
</script>
1 to 2 of 2