hermawanramadhan / CodeIgniter4-DataTables

MIT License
92 stars 38 forks source link

Add arguments to function edit #42

Closed Nounours13 closed 6 months ago

Nounours13 commented 6 months ago

Add 1 argument ($variable) in funtion edit and 2 argument in function callback. It's more usefull to create helper for edit column.

Now function edit is call like this

$datatables->edit($column_name,function($row,$alias,$array_variables),$variable);

The function have now 3 argument

function($row,$alias,$array_variables)

hermawanramadhan commented 6 months ago

I think we no need third argument to throw variable. in php you can do same thing like this:

https://stackoverflow.com/questions/7885513/php-use-function-for-scope

Nounours13 commented 6 months ago

Hi, Yes you have right but, for me, this methode is unusual. I think if you don't add this feature, you should add an exemple in your documentation to explain how to in a case like me who didn't think about it.

That said, if the third argument is not specified, this does not prevent the call from working

Sincerely ...