Skip to content

Instantly share code, notes, and snippets.

@ydatech
Last active September 25, 2017 05:51
Show Gist options
  • Select an option

  • Save ydatech/c2cc10c7f6aaedb2b1a76eabd39d5fcb to your computer and use it in GitHub Desktop.

Select an option

Save ydatech/c2cc10c7f6aaedb2b1a76eabd39d5fcb to your computer and use it in GitHub Desktop.
to om surya
<?php
public function extraFields()
{
$extraFields = [];
$extraFields['desaPerServers'] = function ($model) {
$desaPerServers = $model->desaPerServers;
$arrdesaPerServers = [];
foreach ($desaPerServers as $i => $desa) {
array_push( $arrdesaPerServers, [ 'code'=>$desa->code, 'name'=>$desa->name]);
};
return $arrdesaPerServers;
};
return $extraFields;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment