SMF Development > Applied or Declined Requests
Modifications.template.php
Yoshi:
--- Quote from: emanuele on May 12, 2012, 12:35:37 PM ---I think I have few mods with template files containing just one or two functions (one of which is a dummy for template_layers).
If you want to add a single function and don't feel add a new file you can always edit index.template.php or something similar, it doesn't change so much I think.
Honestly I don't particularly like even modifications.language.php.
Extending even further the parallel we should put also a Modifications.php in Sources then. No?
--- End quote ---
You can, yes. So mods can load Modifications.php from the action array and have a function loaded from there.
IchBin™:
There's really no reason to do this when we have hooks now so you can tie into the system anyway to avoid even using modifications.xxxxxx.
Yoshi:
--- Quote from: IchBin™ on May 12, 2012, 09:11:30 PM ---There's really no reason to do this when we have hooks now so you can tie into the system anyway to avoid even using modifications.xxxxxx.
--- End quote ---
Yes, but why is there a Modifications.language.php then?
IchBin™:
Over time it's basically turning into legacy code IMO.
--- Quote from: Yoshi2889 on May 14, 2012, 11:40:37 AM ---
--- Quote from: IchBin™ on May 12, 2012, 09:11:30 PM ---There's really no reason to do this when we have hooks now so you can tie into the system anyway to avoid even using modifications.xxxxxx.
--- End quote ---
Yes, but why is there a Modifications.language.php then?
--- End quote ---
You're talking about adding a Source file. When there's explicitly a function (integration hook) to allow adding source files. The purpose of a language file really has no relevance for this part. The whole reason there is a language file is because it's always been there. At this point, we could just remove it and tell people to include their own language file. But for some mods, they are so small they don't need to. So having a modifications.english.php file is really not causing any problems.
Why add a basically empty source file and template when these can be included via things like integrate_pre_include ?
Labradoodle-360:
I agree with IchBin and emanuele. In almost every case, I even try to stay away from Modifications.lang.php now. There are workarounds now thanks to hooks and even other clever ways of implementing things that don't require you to modify another file.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version