Add check_placeholder_exists option and setGlobalOptions method#22
Add check_placeholder_exists option and setGlobalOptions method#22ashnazg merged 1 commit intopear:masterfrom
check_placeholder_exists option and setGlobalOptions method#22Conversation
…sts and add a setGlobalOptions method
|
I know the pain (that's exactly how I get involved with this project). However, could you explain more what problem(s) you are trying to solve ? Do you think it's a bug in the library or does your application needs an improvement ? |
|
I don't think the library is bugged, I think If I fix our templates and the usage of the lib (ensure setCurrentBlock, setVariable, parsCurrentBlock, parse... are called correctly according to the template content), it will works well with the current version. But adding an option to skip the And with the second modification I made to globally define the default options, I can also skip the update of the hundreds of HTML_Template_IT instantiation. With this 2 new features, BCBreak free, I can upgrade to the official package simply adding in my code So I don't fix any bugs in HTML_Template_IT, it's more a kind of improvement to make migration easier for developers who start using the lib more than 20 years ago ;) |
|
Sorry for the long delay. I'm trying to understand if your modifications made sense here or if they too strongly to your usage (in which case, you can create a subclass - fixing the call to the constructor should be easier than fixing the calls to the template). Can you explain why do you need to skip Also, I'm not sure you need to add the |
I need to skip this check because I have hundreds (395 exactly) of templates created before this check was introduced
The default value of the new option is true to not BCBreak the lib. In my case instead of update hundreds of I understand this is not really usefull for the lib, I can keep the fork if you reject. |
|
Given that this project is not growing/changing, this PR doesn't seem to do harm, so I'm good with allowing it. |
|
Released in v1.3.3. |
Hi,
I'm trying to get rid of our 10 years old fork migrating legacy code under php8.4 to switch on new servers... Everything works fine if :
checkPlaceholderExiststest...preserve_inputoption tofalseIn this PR, I added a
check_placeholder_existsoption to skip the check, and a staticsetGlobalOptionsmethod to define options globaly for all future instances.Hope you can accept this PR, it will be a real cost saving for me .