-
Notifications
You must be signed in to change notification settings - Fork 45
Template hook system #303
Comments
Is this still required? I'm willing to put something together if needed? |
It would be great, yeah. Currently our focus is on 1.10 where we will hopefully manage to backport this feature.
… On 4 Dec 2017, at 16:34, Ian ***@***.***> wrote:
Is this still required? I'm willing to put something together if needed?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I built a hook system a few months back, pretty simple so I can create a PR when I get a chance. |
Sounds awesome, I'll quickly outline the kind of thing I'm hoping for 😄
{{ hook('header-welcomeblock_member_end') }}
$hookManager = app('template_hooks;); // Example of the hook manager's registered name in the DI
$hookManager->addHook('header-welcomeblock_member_end', function(\Twig_Environment $twig) {
// do some stuff and return a rendered view here
return $twig->render('foo');
});
I can't think of anything else at the moment - perhaps @Eric-Jackson or @justinsoltesz have some items on their wishlist (or anybody else out there - feel free to chime in with your wishes!). THe naming of things is always the hardest part I find, so feel free to use names other than |
Sounds good, below is what I hacked together a few months ago for a project, with a little tweaking and exposing the methods to Twig it should be golden. I need to add priority, basically just sort the array. I'll write a checklist at the end, if you can confirm then I can put it in MyBB
I named it HookContainer as it contains all the hooks - this isn't limited to templates, I exposed it via IoC then wrapped a helper method so I could essentially do
Is that correct? |
@euantorano Hope you don't mind the little bump |
Sorry, I somehow missed the notification for your reply @1e4! Looks good to me. The only points I see are:
|
No problem @euantorano, there are also no Facades. The |
Afternoon @euantorano Christmas & New Year were busier than I expected, I'll look at making progress on it this week and keep you posted. |
Happy new year!
No problem, I know that feeling for sure 😀
… On 2 Jan 2018, at 16:23, Ian ***@***.***> wrote:
Afternoon @euantorano Christmas & New Year were busier than I expected, I'll look at making progress on it this week and keep you posted.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Happy New Year @euantorano I hope MyBB 2 gets a BETA this year ^_^, hoping to contribute as much as I can to make this happen |
The current focus is upon 1.9, 1.10 and other incremental steps in the 1.x line due to community demand.
… On 2 Jan 2018, at 16:42, Ian ***@***.***> wrote:
Happy New Year @euantorano I hope MyBB 2 gets a BETA this year ^_^, hoping to contribute as much as I can to make this happen
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Template hook system, allowing plugins and modules to easily output and modify template content without requiring edits to templates (removing the requirement for
find_replace_templatesets
). This should be less prone to error and make managing themes much easier (installing a new theme should mean that plugins just work).The text was updated successfully, but these errors were encountered: