Conversation
|
Sorry, but I don't like this approach. The registerplugin methods are the "old" way to register plugins. I'm in favor of creating new Extensions. Wouldn't it be easier to switch the default loading order of the Extensions? It is now: core, default, BC. We could change it to core, BC, default. |
|
Thanks for your quick reply. You're right, it would have been be easier to switch the default loading order of the Extensions : Core, BC, then Default. In that case DefaultExtension->getModifierCompiler() is going to take the lead anyway. Side question : |
Yes, it might. |
Is there any documentation about creating Extensions? In the official smarty.net docs I found none and I also found nothing in the GitHub repo. If we need to create Extensions we need documentation for it. As long as I know, the only "official" way to extend capabilities is the "old" way. And this PR would fix an issue regarding to the "old" way. Would it possible to take an account to fix an "old" behavior until we get the "new" way get properly documented? |
|
I found this, but this is just a partial documentation. You do not show how the compiler/callable you pass the execution to, should interact with Smarty. Is this just echo-ing something to the output? It returns with a string? A working hello world example and some detailed documentation about how the extension should behave would needed if you want to completely drop something much easier to use. Registering a plugin was (or, at least felt like) easier than integrating something with your compilation process. The best would be some articles about the transition. Giving an example of a simple plugin and how it should look like when you migrate it to the new, extension system. |
|
That part didn't really change, but you are right, that would be very useful. Feel free to drop a MR if you can find the time for it. |
A proposition to fix #1048 (and may be a part of #1011 too)
This is to prevent modifiers added by registerPlugin function from beeing silently ignored by DefaultExtension.
More details in #1048