I am trying to create my own blocks or wrappers to apply to anything within Volt code, for example:
{% uglify %}
<script>
var x = 'a bunch of javascript here';
{% end %}
I know how to create custom:
- Tags:
{{ SomeModule::init(volt.value) }}
- Filters
{{ volt.value|random }}
- Function:
{{ random(volt.value) }}
Can I accomplish something like the above with inline JavaScript? {{ uglify(' window.x = { param: 'param.from['volt']', deeper: { more: 'param.from['volt2']` } } ') }}
Is that crazy? Maybe I should just have an external JS file and run it through there? This is a strange case for what Im doing I suppose any thoughts would be appreciated :)
Furthermore, Zephir is absoltely awesome. I was looking in the CPhalcon repository all I could find was this below, if this is the correct item:
- /mvc/engine/volt/compiler line 1380
- Url to Line in Repo Here
The code looks like this below and it seems that Block Statements are only {% block name %}...{% endblock %}
, nothing customizable I don't think. This is a feature Django has with Django Pipelines.
if type == PHVOLT_T_ELSEFOR {
let compilation .= "<?php $" . prefixLevel . "iterated = false; ?>";
let forElse = prefixLevel;
let this->_forElsePointers[level] = forElse;
break;
}