Use php in display list

webcrea 02 Jun, 2015
Hi,

Could you show me an example how to use PHP Functions because I don't undestand this

Multi line list of fields with function definition, the definition string is passed to a create_function function which accepts 2 params, $cell for current field value and $row for current row data,
e.g:Model.field:return $cell;

where is create_function ?

the ultimate goal is to change \n in <br />
return str_replace( "\n", "<br />", $my_field);
GreyHead 02 Jun, 2015
Hi webcrea,

I've read this a couple of times but still don't understand what you are asking here :-(

I can see that you want to do a string replacement. Where do you want to do this and on what data?

And what or where is the create_function function???

Bob
webcrea 02 Jun, 2015
Sorry for my poor english and I posted in wrong forum,

In chronoconnectivity How to (maybe you can move my topic ?)

In "Front List", Settings, Display type=Table, you can find a textarea named "PHP functions" with an explanation under it

"Multi line list of fields with function definition, the definition string is passed to a create_function function which accepts 2 params, $cell for current field value and $row for current row data, e.g:Model.field:return $cell;"

I don't undestand how to do

Best regards Bob
webcrea 03 Jun, 2015
nobody knows?
webcrea 03 Jun, 2015
I find, thanks to Max

Comprofiler.cb_honor_list:return str_replace("\n","<br />", $row["Comprofiler"]["cb_honor_list"]);
This topic is locked and no more replies can be posted.