Skip to content

Instantly share code, notes, and snippets.

@helhum
Last active September 27, 2018 09:08
Show Gist options
  • Save helhum/4312dec1ca8076a5a65c to your computer and use it in GitHub Desktop.
Save helhum/4312dec1ca8076a5a65c to your computer and use it in GitHub Desktop.
Using TS rendering
{namespace t=Helhum\TyposcriptRendering\ViewHelpers}
<button class="ajax-button" data-ajaxUri="{t:uri.ajaxAction(action: 'foo', controller: 'bar') -> f:format.htmlentities()}">
Click Me
</button>
<script type="text/javascript">
jQuery.ajax(
jQuery(".ajax-button").data("ajaxUri")
).done(
function(result) {
console.log(result);
}
);
</script>
@schams-net
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment