How do I get user id and pass to view ?

Before I got a problem, I used $_COOKIE['ck_login_id_20'] to get user id.

I don't know why $_COOKIE['ck_login_id_20'] is gone.

I have my custom layout and view, in view I put <iframe> that call page.php to show something.

In my idea, I want to get user id, then pass into my-view and put in my iframe like this <iframe src="page.php?id={{ user_id }}" class="myiFrame" frameborder="0">

I found SugarCRM 7 - Passing Data to Views It may be good way.

Do you have any idea?

SugarCRM Professional, Version 7.5.2.0

Thanks,

M

Parents
  • I am not sure I understand the context of where or how it is you are intending to pull the User ID, but if we assume you are working in the controller for a 7.x view, with the intention of invoking a custom view, one can get the current user's ID as such:

    var UserID = app.user.id;

Reply
  • I am not sure I understand the context of where or how it is you are intending to pull the User ID, but if we assume you are working in the controller for a 7.x view, with the intention of invoking a custom view, one can get the current user's ID as such:

    var UserID = app.user.id;

Children