willinit Posted February 12, 2019 Share Posted February 12, 2019 I currently have a hook for ClientLogin that takes the userid value and pulls the corresponding e-mail address from the database. What I'm trying to achieve next is to take that value and pass it to a javascript line in the Client Area page after successful login. But from what I've read, the hooks have limited scopes in terms of creating a new template variable and creating a template variable wouldn't allow it to be access in a template file that doesn't correspond to ClientLogin. Is it possible to take the returned value from the ClientLogin hook and pass it to another hook that (from my understanding) would have its own limited set of template files where the template variable would be accessible? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 13, 2019 Share Posted February 13, 2019 12 hours ago, willinit said: Is it possible to take the returned value from the ClientLogin hook and pass it to another hook that (from my understanding) would have its own limited set of template files where the template variable would be accessible? I wouldn't have thought it necessary to pass a value from one hook to another - not least because once the user is logged in, then all the ClientAreaPage hooks will have access to the Smarty variables in that template via $vars... one of which will be $clientsdetails - so if you wanted to get the clients email address value in the hook... $clientemail = $vars['clientsdetails']['email']; there would be other ways to get it (e.g., you could get it via the class docs) - but if they're logged in, you shouldn't need to pull the value from another hook - or even query the database for it. 0 Quote Link to comment Share on other sites More sharing options...
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.