Thank you for your reply Lajos.
Finally i found a good starting point for non js / css assets (i am at the beginning) and have dillemma over another approach in less framework way using macros. The underlaying thing is trying not to load another classess but to use pure framework.
So the starting more acceptable way:
backend:
$this->assets->addInlineCodeByType('aaa', new \Phalcon\Assets\Inline('test', 'some text html <b>asdf</b>'));
in volt
{{assets.outputInline(assets.collection('aaa'), 'js')}}
another approach for pseudo assets (html snippets/ boxes) (not polished yet)
backend in controller base file:
protected function addHtml($name="default", $html, $subposition=10, $priority=100) {
if ($name===null) $name="default";
if (!isset($this->htmlassets[$name])) $this->htmlassets[$name]=array();
if (!isset($this->htmlassets[$name][$subposition])) $this->htmlassets[$name][$subposition] = array();
if (!isset($this->htmlassets[$name][$subposition][$priority])) $this->htmlassets[$name][$subposition][$priority] = array();
$this->htmlassets[$name][$subposition][$priority][]=$html;
/*echo "<pre>";
print_r($this->htmlassets);
echo "</pre>";
ob_flush();*/
}
then volt macro:
{%- macro boxes(params) %}a
{#
for cache purposes all data should be easily serializable
params unnamed [0,1,2,3]
1. name - boxes by name
2. items array[boxnameorid] =
array of subpositions array[int boxnameorid][1] (10 should be default)
where in each position
array of items or array of items rendered in a tree order (site has a parent with inherited boxes) already sorted out according to their priority.
3. optional mode - "edit"
4. optional style_id - basically in what each element it is wrapped
2. optional ["t"]: translation object (for example for edit interface)
#}
{% for position_id, subpositionarray in params[1][params[0]]|sort %}
<div>{{position_id}}
{% for priority, priorityarray in subpositionarray|sort %}
<div>{{priority}}
{% for html in priorityarray %}
<div>{{html}}</div>
{% endfor %}
</div>
{% endfor %}
</div>
{% endfor %}
{%- endmacro %}
then in template/layout
{{boxes(["default", htmlassets, front_end_edit, t])}}
then domewhere in the backend
$this->addHtml(null, "one html", 10, 100);
$this->addHtml(null, "two html");
$this->addHtml(null, "third html", 10, 10);
$this->addHtml('default', "forth html", 5, 100);
$this->addHtml("header", "fifth header html");