Extension to use TPL tags and functions in menu slots
Macik |
|
---|---|
#36386 Trustmaster: It's a good practice and I use it too. But… It has a back (negative) side. If we use this style: «insert_me_anywhere» callbacks - we force to load bundle of code in advance, so we have pack of functions in global space that can be called never at all. For example, lets see in «attach2» plugin (it's great itself but I speaking now about callback styles only). It always load `attach2.functions.php` in «global» hook. What does it mean - 23kb file loaded and adds 26 addition functions in global space. It's not terrible themself but it happend on all pages. More plugins - more junk loaded and waste resources. And I think we have to choose solution from 2 ways:
And I preffered second one. So it should be simple to inplement, not crashed logic of use tpl callbacks, and can be done backward compatible in plugins. https://github.com/macik
правильный хостинг — https://goo.gl/fjCa1F |
|
This post was edited by Macik (2012-12-02 19:55, 11 years ago) |