Browse Source

[Templating] renamed content slot to _content to avoid name collisions

Fabien Potencier 15 năm trước cách đây
mục cha
commit
7fce03c5bd
1 tập tin đã thay đổi với 3 bổ sung3 xóa
  1. 3 3
      src/Symfony/Components/Templating/Engine.php

+ 3 - 3
src/Symfony/Components/Templating/Engine.php

@@ -121,12 +121,12 @@ class Engine
     if ($this->parents[$name])
     {
       $slots = $this->get('slots');
-      $this->stack[] = $slots->get('content');
-      $slots->set('content', $content);
+      $this->stack[] = $slots->get('_content');
+      $slots->set('_content', $content);
 
       $content = $this->render($this->parents[$name], $parameters);
 
-      $slots->set('content', array_pop($this->stack));
+      $slots->set('_content', array_pop($this->stack));
     }
 
     return $content;