Sim Posted May 8, 2020 Posted May 8, 2020 (edited) Anyone been able to display a message from a hook? I seen to be having issue with it. I get no errors, but I get no display message either global $html, $page; $page->buildElement("success", array("text" => " tezzzeszzzz.")); Nothing =( I also tried playing with the templating hook a bit and couldn't seem to do it https://github.com/ChristopherDay/Gangster-Legends-V2/wiki/Hooks.templating Edited May 8, 2020 by Sim Quote
Tom V Posted May 8, 2020 Posted May 8, 2020 Is this what you're looking for? $this->alerts[] = $this->page->buildElement("success", array("text" => $text)); Quote
Sim Posted May 8, 2020 Author Posted May 8, 2020 57 minutes ago, Tom V said: Is this what you're looking for? $this->alerts[] = $this->page->buildElement("success", array("text" => $text)); I know of that. They dontb display when adding the code in hooks. That one doesn't work either @ags_cs4 Quote
Dave Posted May 8, 2020 Posted May 8, 2020 Sounds like you need to work out what context you need, $this will be different when you’re inside a closure, you most likely need to import something using globals Quote
Sim Posted May 8, 2020 Author Posted May 8, 2020 I used the globals page and html. It didn't add the messages to the template like I figured it would unfortunately. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.