Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

how to combine volt variable and php variable in volt?

in volt template file:

some operate need to use php process, but i don't know how to transfer volt var to php?

such as:

$.ajax({
    url: "<?php echo $this->url->get("cities/get/".{{items.id}}) ?>"
})
.done(function() {
    alert("Done!");
});
</script>


3.6k
Accepted
answer

This should work: <?php echo $this->url->get("cities/get/".$items->id ) ?>



11.9k

@rvanderfeer, you are right. i tested it .

thank you