I am trying to use Twig with CakePHP, so I installed this plugin:
https://github.com/predominant/TwigView
And in CakePHP's demo, we build a blog, and I can use this in a tpl file:
{% for post in posts %}
<tr>
<td>{{post.Post.id}}</td>
<td>{{post.Post.title}}</td>
<td>Edit | Delete</td>
<td>{{post.Post.created|date("F j, Y")}}</td>
</tr>
{% endfor %}
What I can't get to work, is converting this:
<?php
echo $this->Html->link(
'Add Post', array('controller' => 'posts', 'action' => 'add')
);
?>
I have tried all of these, and none of them work:
{{ html.link("Add Post", {"controller" : "posts", "action" : "add"}) }}
{{ _view.html.link("Add Post", {"controller" : "posts", "action" : "add"}) }}
{{ this.html.link("Add Post", {"controller" : "posts", "action" : "add"}) }}
I don't get any errors, it just gets replaced with nothing. Anyone know how I can fix this issue?