You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey there,
not sure if this is a bug, but I tried the following without success:
$array = [['columnName', 'two'],['columnName2','two2']];
foreach ($array as $x) {
$this->my_variable = $x;
$crud->callback_column($x[0], function ($fieldValue) {
return $x[1]; });
};
For the first Loop this works, but on all other loops it seems like conflicting with overwriting each other or something, I really don't clearly understand what is goin on there, as the result is not logic anymore. Some values get completely added to a wrong column and some are not introduced at all.
I would be happy about any help.
Thank you very much :)
The text was updated successfully, but these errors were encountered:
Fellaz, I got it, please spread this across the groceryCRUD forums aswell as I was not able to find this solution there, it was not even provided by the admins. The suggestion was always to use $this->variable or a session, but there is something easier, which works for those anonymous functions. You can pass as many variables to the function as you want to by the use statement, reference here: Anonymous Functions
function ($requiredParams) use ($yourvar1, $ yourvar2, etc.) {
....};
Hey there,
not sure if this is a bug, but I tried the following without success:
For the first Loop this works, but on all other loops it seems like conflicting with overwriting each other or something, I really don't clearly understand what is goin on there, as the result is not logic anymore. Some values get completely added to a wrong column and some are not introduced at all.
I would be happy about any help.
Thank you very much :)
The text was updated successfully, but these errors were encountered: