File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change @@ -704,6 +704,53 @@ in your application configuration:
704
704
),
705
705
));
706
706
707
+ .. versionadded :: 2.2
708
+ Default templates per render tag was added in Symfony 2.2
709
+
710
+ You can define default templates per ``render `` tag (which will override any global default templates that is defined):
711
+
712
+ .. configuration-block ::
713
+
714
+ .. code-block :: jinja
715
+
716
+ {% render '...:news' with
717
+ {},
718
+ {'standalone': 'js', 'default': 'AcmeDemoBundle:Default:content.html.twig'}
719
+ %}
720
+
721
+ .. code-block :: php
722
+
723
+ <?php echo $view['actions']->render(
724
+ '...:news',
725
+ array(),
726
+ array(
727
+ 'standalone' => 'js',
728
+ 'default' => 'AcmeDemoBundle:Default:content.html.twig',
729
+ )
730
+ ) ?>
731
+
732
+ Or you can also specify a string to display as the default content:
733
+
734
+ .. configuration-block ::
735
+
736
+ .. code-block :: jinja
737
+
738
+ {% render '...:news' with
739
+ {},
740
+ {'standalone': 'js', 'default': 'Loading...'}
741
+ %}
742
+
743
+ .. code-block :: php
744
+
745
+ <?php echo $view['actions']->render(
746
+ '...:news',
747
+ array(),
748
+ array(
749
+ 'standalone' => 'js',
750
+ 'default' => 'Loading...',
751
+ )
752
+ ) ?>
753
+
707
754
.. index ::
708
755
single: Templating; Linking to pages
709
756
You can’t perform that action at this time.
0 commit comments