1. Go to this page and download the library: Download virbo/yii2-wsfeeder library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
/*
* mengambil dictionary dari setiap method. dalam contoh ini akan
* ditampilkan dictionary dari method InsertNilaiTransferPendidikanMahasiswa
* */
public function actionDictionary()
{
$data = [
'act' => 'GetDictionary',
'fungsi' => 'InsertNilaiTransferPendidikanMahasiswa'
];
return Yii::$app->feeder->actFeeder($data);
}
/*
* menampilkan data mahasiswa sebanyak 10 data.
* */
public function actionListData()
{
$data = [
'act' => 'GetListMahasiswa',
'filter' => null,
'order' => null,
'limit' => 10,
'offset' => 0
];
return Yii::$app->feeder->actFeeder($data);
}
/*
* Filter data mahasiswa berdasarkan id mahasiswa (untuk list field2 yang
* ada di method GetListMahasiswa, bisa diliat menggunakan method GetDictionary.
* */
public function actionFilterData()
{
$data = [
'act' => 'GetListMahasiswa',
'filter' => "id_mahasiswa = '0d06b023-0ff6-4a08-a8d2-a9e31b39a095'",
'order' => null,
'limit' => 10,
'offset' => 0
];
return Yii::$app->feeder->actFeeder($data);
}
/*
* Update data berdasarkan id. Dalam contoh ini update data mahasiswa berdasarkan ID mahasiswa
* */
public function actionUpdateData()
{
$data = [
'act' => 'UpdateBiodataMahasiswa',
'key' => [
'id_mahasiswa' => '0d06b023-0ff6-4a08-a8d2-a9e31b39a095'
],
'record' => [
'nama_mahasiswa' => 'Pangeran Khairan Asshabir Yusuf Ayuba',
]
];
return Yii::$app->feeder->actFeeder($data);
}
/*
* Delete data. dalam contoh ini menghapus data mahasiswa berdasarkan ID mahasiswa
* */
public function actionDeleteData()
{
$data = [
'act' => 'DeleteBiodataMahasiswa',
'key' => [
'id_mahasiswa' => '0d06b023-0ff6-4a08-a8d2-a9e31b39a095'
],
];
return Yii::$app->feeder->actFeeder($data);
}
php composer.phar
php composer.phar update
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.