Quantcast
Channel: phpBB.com
Viewing all articles
Browse latest Browse all 2220

Extension Writers Discussion • Re: Passing data array to custom function in miration

$
0
0
In theory (never tested myself) it should work like that

Code:

public function update_data(){$args = ['data' => ['var_1'=> 1,'var_2'=> 1,'var_3'=> 0,]];return [// Call a custom callable function to perform more complex operations.['custom', [[$this, 'callable_install'], $args]],];}public function callable_install($data){// Run some SQL queries on the database}

Internally call_user_func_array($callable, $parameters); is used, so it follows https://www.php.net/manual/en/function. ... -array.php

EDIT: changed the array and the call to make it more clear.

Statistics: Posted by rxu — Fri Apr 11, 2025 1:52 pm



Viewing all articles
Browse latest Browse all 2220

Trending Articles