|
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 |
hexetic Smarty n00b
Joined: 08 Dec 2015 Posts: 3
|
Posted: Tue Dec 08, 2015 7:52 pm Post subject: Create functions in intermediate inherited templates? |
|
|
If I have the inheritance chain A->B->C (i.e., C extends from B which extends from A), it seems like there's no way for B to declare a {function} that {C} could use. The Smarty docs say that the compiler will ignore anything except {block} declarations in B.tpl, but there's no way for C to use functions declared within one of B's blocks, is that right?
I would really like to be able to declare functions in B that would be visible to B's children but not to all of A's children. A is a global presentation template that defines the basic layout of the webpage. B is a refinement for a specific area of the website. C is a particular page. There are some things which are common to B's area but none of the other pages. |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Wed Dec 09, 2015 12:09 pm Post subject: |
|
|
Overengineering at its finest.
Do not define "functions in templates", problem solved.
If you need template function, define it as a plugin. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Thu Dec 10, 2015 4:47 am Post subject: |
|
|
This will be possible with the next release 3.1.28 which I will release next week. You can try already the version in the master branch on github. |
|
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
|