This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function extraFields() | |
{ | |
$extraFields = []; | |
$extraFields['desaPerServers'] = function ($model) { | |
$desaPerServers = $model->desaPerServers; | |
$arrdesaPerServers = []; | |
foreach ($desaPerServers as $i => $desa) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* MoveLayer (ES6 class) | |
* Move array item up and down | |
*/ | |
class MoveLayer{ | |
static to(direction ='up',data = { items:[] , activeIndex:0}){ | |
if(data.activeIndex >= data.items.length-1 || data.activeIndex <= 0 || !Array.isArray(data.items)) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#generate file migrasi untuk menambahkan kolom status pada tabel iklan | |
php yii migrate/create add_status_column_to_iklan_table --fields="status:smallinteger" | |
#terapkan migrasi ke database | |
php yii migrate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace app\models; | |
use Yii; | |
use yii\behaviors\TimestampBehavior; | |
use yii\behaviors\AttributeBehavior; | |
use yii\db\ActiveRecord; | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'urlManager' => [ | |
'enablePrettyUrl' => true, | |
'enableStrictParsing' => true, | |
'showScriptName' => false, | |
'rules' => [ | |
'GET '=>'site/index', | |
'POST auth/signup'=>'auth/signup', | |
'POST auth/login'=>'auth/login', | |
'GET lokasi'=>'lokasi/index', | |
'GET kategori'=>'kategori/index', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace app\controllers; | |
use Yii; | |
use yii\data\ActiveDataProvider; | |
use yii\web\ForbiddenHttpException; | |
class KontakController extends ActiveController{ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace app\controllers; | |
use yii\filters\Cors; | |
use yii\filters\auth\HttpBearerAuth; | |
class ActiveController extends \yii\rest\ActiveController{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace app\models; | |
use Yii; | |
/** | |
* This is the model class for table "kategori". | |
* | |
* @property integer $id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'urlManager' => [ | |
'enablePrettyUrl' => true, | |
'enableStrictParsing' => true, | |
'showScriptName' => false, | |
'rules' => [ | |
'GET '=>'site/index', | |
'POST auth/signup'=>'auth/signup', | |
'POST auth/login'=>'auth/login', | |
'GET lokasi'=>'lokasi/index' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace app\models; | |
use Yii; | |
/** | |
* This is the model class for table "provinsi". | |
* | |
* @property integer $id |