我想覆蓋AdmingeneratorGeneratorBundle的一個字段,並希望將鏈接附加到某個字段。這工作得很好繼documentation:覆蓋AdmingeneratorGeneratorBundle的一個字段
{% extends_admingenerated "MyMainBundle:PageEdit:index.html.twig" %}
{% block form_status %}
{{ parent() }}
<a href="{{ path("_admin_preview", {'id': 8, '_format': 'pdf'}) }}">Preview</a>
{% endblock %}
什麼我現在需要做的,是讓我的網頁,而不是靜態8的真實身份,但我無法弄清楚,什麼對象被稱爲在樹枝模板裏面。有任何想法嗎?
更新: 在我的情況下,我只需要我的頁面的ID,我可以使用app.request.attributes.get(「PK」)來獲得它的樹枝。如果讓其他價值觀變得艱難,會很有趣。
我在AdminGenerator用戶羣開始的話題。 https://groups.google.com/group/symfony2admingenerator/browse_thread/thread/772c37c1f73575a – madc