Bladeren bron

Merge pull request #2846 from zergu/patch-1

Docs custom action: notice about creating template
Thomas 10 jaren geleden
bovenliggende
commit
1bfb643347
1 gewijzigde bestanden met toevoegingen van 14 en 0 verwijderingen
  1. 14 0
      Resources/doc/cookbook/recipe_custom_action.rst

+ 14 - 0
Resources/doc/cookbook/recipe_custom_action.rst

@@ -121,6 +121,20 @@ to implement a ``clone`` action.
 Here we first get the id of the object, see if it exists then clone it and insert the clone
 as a new object. Finally we set a flash message indicating success and redirect to the list view.
 
+Using template in new controller
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+If you want to render something here you can create new template anywhere, extend sonata layout
+and use `sonata_admin_content` block.
+
+.. code-block:: html+jinja
+
+    {% extends 'SonataAdminBundle::standard_layout.html.twig' %} 
+
+    {% block sonata_admin_content %}
+        Your content here
+    {% endblock %}
+
 Create a template for the new action
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^