【发布时间】:2015-05-08 17:36:40
【问题描述】:
我想知道是否有一种解决方法可以将 twig 与 haml 结合用于 symfony2 视图。
这是 Haml http://haml.info/(这是用于 Ruby On Rails)基本上就是用这个:
%section.container
%h1= post.title
%h2= post.subtitle
.content
= post.content
而不是这个:
<section class=”container”>
<h1><%= post.title %></h1>
<h2><%= post.subtitle %></h2>
<div class=”content”>
<%= post.content %>
</div>
</section>
这是 php https://code.google.com/p/phamlp/ 的版本,但我想知道我是否可以在 Symfony 2 中使用它
【问题讨论】:
-
是的,这是可能的。不知道 haml 是什么或如何将它与 twig 结合,但 Symfony 2 本身是非常可扩展的。我建议在您的浏览器中找到搜索栏,将您的问题复制到栏中,然后按搜索按钮。您可能会对结果感到惊讶。