|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
ilyalyu Smarty Regular
Joined: 03 Nov 2009 Posts: 72
|
Posted: Fri Aug 24, 2012 8:26 pm Post subject: Prepending/appending smarty blocks |
|
|
Code: |
template1.html
{block 'a'}1{/block}
template2.html
{extends 'template1.html'}
{block 'a' prepend}2{/block}
template3.html
{extends 'template2.html'}
{block 'a' append}3{/block}
template3.html output:
231
I would expect the following output:
213
|
It seems that Smarty (1) first appends 3 to 2, which produces 23 and (2) next prepends 23 to 1, which produces 231.
I would expect Smarty (1) first to extend template1, which should produce 21 and (2) next to extend template2, which should produce 213. In other words, if I use the code {block 'a' append}3{/block} in the last template, I expect to find 3 in the end, and not in the middle. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Fri Aug 24, 2012 11:52 pm Post subject: |
|
|
No, the processing order of templates is 1.) grandchild, 2.) child, 3.) parent.
The content of 231 is the expected result. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|