Artis Posted January 24, 2017 Report Posted January 24, 2017 Hello, I'm using my own plugin and I'm not able to get user ID (that is currently login) in view. Is there easy solution for displaying user ID in view ? I saw this code in template pdt <?php $this->_("ClientMain.myinfo.client_id", false, $this->Html->_($client->id_code, true));?> But that code is not working in my view. Quote
Michael Posted January 24, 2017 Report Posted January 24, 2017 Try <?php echo $this->Html->_($client->id_code, true); ?> Quote
Artis Posted January 24, 2017 Author Report Posted January 24, 2017 Thanks for reply, I already try this and I have empty value, from var dump I'm receiving this string(0) "" Quote
Paul Posted January 25, 2017 Report Posted January 25, 2017 21 hours ago, Artis said: Thanks for reply, I already try this and I have empty value, from var dump I'm receiving this string(0) "" Are you trying to get the user id of a client or admin? Quote
Artis Posted January 25, 2017 Author Report Posted January 25, 2017 @Paul I want to get user ID from client. Example 1500, 1501, ... I tried to login as user and check user ID but I still receive empty string. Quote
Paul Posted January 25, 2017 Report Posted January 25, 2017 1 hour ago, Artis said: @Paul I want to get user ID from client. Example 1500, 1501, ... I tried to login as user and check user ID but I still receive empty string. This code works in my testing when added to the top of /app/views/client/bootstrap/structure.pdt <?php echo $this->Html->_($client->id_code, true); ?> However, you must LOG IN as the client, it will not work if you are an admin and use the "login as client" feature. Michael 1 Quote
Artis Posted January 26, 2017 Author Report Posted January 26, 2017 @Paul thanks for information. That option is valid for /app/views/client/bootstrap/structure.pdt but I'm using my own plugin and I'm not able to get ID from client (in my plugin) is there documentation link what I can check how to get user ID in view (with my plugin)? Quote
Paul Posted January 26, 2017 Report Posted January 26, 2017 9 hours ago, Artis said: @Paul thanks for information. That option is valid for /app/views/client/bootstrap/structure.pdt but I'm using my own plugin and I'm not able to get ID from client (in my plugin) is there documentation link what I can check how to get user ID in view (with my plugin)? I'm not sure what you'd need to do specifically without bringing in one of our developers, however I'd suggest looking at the "Support Manager" plugin. All the code is open, and Blesta does utilize the Client ID when opening trouble tickets as a client, so looking at that plugin should be helpful. 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.