Echo toolbar button names via PHP

Is there any way to echo toolbar button names via PHP (like config file)?

Something like <php echo $name; ?>

Any examples would be greatly appreciated (if possible).



It depends from which source you want to echo !
For example, is it from a database or a file where the name’s list exist ?


Hi Gilbert.

Using sqlite db file for this app.

From time to time use a config.php to store values but moving mostly to sqlite.


If I understand, you want to change the names of the buttons in the UI through PHP? We have a demo script in the general demo that changes the caption of the button although this is with HEScript, it can be adapted to be run from PHP too. Is it what you are looking for?

1 Like

Yes, you are correct.

I was looking at the “Ask User” HEScript but did not see how it could be adopted to PHP (or echo from sqlite database). Played around with HEScript trying to get working with vars.php in samples folder but never got anywhere.

If you have time for example, sure would appreciate it.

You can change UI buttons with this HEScript code. For instance, the Home button in the ribbon can be accessed with ID ribbon1BHome. ID is name of the component (ribbon1) followed by name of the control (defined in the UI editor).

procedure Procedure1(text: String);
 SetUiProp("ribbon1BHome", "Caption", text);

So add the script above to the UserMain HEScript script of your project (see

Then, it can be run from PHP with:

exo_return_hescriptcom ('UserMain.Procedure1|New Caption', '');

The | indicates that we pass a parameter (here the value for the text parameter of the Procedure1 procedure defined in the UserMain script).

1 Like

Thanks, I had tried that some time back but could never get the value form a config file to echo.

For instance, just tried again:

require './samples/vars.php';
exo_return_hescriptcom ('UserMain.Procedure1|<?php echo $homebutton; ?>', '');

The <?php echo $homebutton; ?> is returned as button name.

Looking for a way to echo a button name from php file or my sqlite database.

It won’t work with that syntax.
Try instead:
exo_return_hescriptcom ("UserMain.Procedure1|$homebutton", '');

I seem to embarrass myself every time. So simple and did not catch that.

Is there a way to do more than one button? I tried:

require './samples/vars.php';
exo_return_hescriptcom ("UserMain.Procedure1|$homebutton", '');
exo_return_hescriptcom ("UserMain.Procedure3|$gobutton", '');

That does not seem right, so tried:

exo_return_hescriptcom ("UserMain.Procedure1|$homebutton", ''),("UserMain.Procedure3|$gobutton", '') ;

and resulted in error.

Thanks for your help.

EDIT: forgot to show my HEScript:

procedure Procedure3(text: String);
 SetUiProp("ribbon1scButton3", "Caption", text);

Seems I have worn my welcome out on this question, lol. Will try one more time with another since last one not answered:

Everything works ok when changing a single button and echo’ing from vars.php.

But I really need to pull data from my sqlite database.

When I use exo_return_hescriptcom ("UserMain.Procedure3|$row['supporttext']", ''); error is thrown.

Possible (please) to give me example how you would use an entry from sqlite database?


The problem comes from the fact that we are trying to modify the GUI through PHP. However, this is not recommended because GUI and PHP are in separate threads.

Change the code to this:

  exo_runhescriptcom ("UserMain.Procedure3|$gobutton");
  exo_runhescriptcom ("UserMain.Procedure1|$home");

and it seems to work better.

That’s an error in PHP syntax. When you use quotes, you can pass string variables. That’s all.

$gobutton = $row[‘supporttext’];
exo_runhescriptcom (“UserMain.Procedure3|$gobutton”);

Ok, think I am clear on usage, appreciate you taking time to walk me through.

When trying this on the general demo, all seems to work fine. But, my software apps do not use a ribbon, only toolbar (or panel?).

My toolbar is “ptop” and my button is “scButton1”. I have tried:

procedure Procedure3(text: String);
 SetUiProp("scButton1", "Caption", text);


procedure Procedure3(text: String);
 SetUiProp("ptopscButton1", "Caption", text);

Cannot get button text to change?

Forget last question. Totally related to up all night working and should be in bed:) Spaced out and should have used:

procedure Procedure3(text: String);
 SetUiProp("toolbar1scButton1", "Caption", text);

Unfortunately above not pulling data from sqlite, getting “Undefined variable: row”. Can echo on same page using <?php echo $row['supporttext'];?> so know database working.

Anyone got some tips, sure appreciate them:)

UPDATE: Had to move above down a few lines so row was defined… Now working fine.

Time for sleep so I do not embarrass myself anymore:)

Another related question, please…

Is it possible to also link the button to url and have open in users default browser using scripting?

Using this on modal popup and would like to use in scripting if at all possible:

<a href="heexternal://<?php echo $row['supporturl'];?>"><?php echo $row['supporttext'];?></a></p>

Sorry for all the scripting questions, just cannot seem to grasp…

Can you publish sqlite path and table content ?



Using as folowing:

procedure Procedure1(text: String);
SetUiProp(“Toolbar1BHome”, “Caption”,text);

procedure Procedure2(text: String);
SetUiProp(“Toolbar1bprint”, “Caption”,text);

It is only changing the caption button of first line:

exo_return_hescriptcom (“UserMain.Procedure1|homepage”.’’);
exo_return_hescriptcom (“UserMain.Procedure2|Printer”,’’);

Only home caption button is changing

But when i use it as follow:

exo_return_hescriptcom (“UserMain.Procedure2|Printer”,’’);

Only print caption button is changing


Ok, found solution (it was my mistake):



rather than


Now, how is it possible to have it all as a unique hescript ?
I mean more that to have to write a procedure for each button caption, to put everything in only one hescript and use it as follow;

exo_runhescriptcom(procedure | toolbar+button name | caption, " ")