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

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(){$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'], $data]],];}public function callable_install($var_1, $var_2, $var_3){// 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

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



Viewing all articles
Browse latest Browse all 2212

Trending Articles