This file contains 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 | |
$model->addRule(['name', 'body'], 'required') | |
->addRule(['name'],function()use($model){ | |
if(count(array_unique($model->name)) != count($model->name){ | |
$model->addError('name','Name harus unik'); | |
} | |
}); |
This file contains 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
$('#id_harga, #id_qty').change(function(){ | |
$('#id_total').val($('#id_harga').val()*$('#id_qty').val()); | |
}); |
This file contains 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\components; | |
use yii\web\View; | |
/** | |
* JsBlock | |
* | |
* @author Misbahul D Munir <[email protected]> |
This file contains 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 | |
// class User | |
class User extends ActiveRecord | |
{ | |
... | |
public function behaviors() | |
{ | |
return [ | |
[ | |
'class' => 'mdm\upload\UploadBehavior', |
This file contains 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\components; | |
use yii\base\UnknownPropertyException; | |
use yii\base\UnknownMethodException; | |
/** | |
* Prototype | |
* |
This file contains 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; | |
/** | |
* Description of TestAngularController | |
* | |
* @author Misbahul D Munir <[email protected]> | |
* @since 1.0 | |
*/ |
This file contains 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
Kelas = function() { | |
var c = function() { | |
if (this.initialize) { | |
this.initialize.apply(this, arguments); | |
} | |
} | |
function Extend(dst, src) { | |
for (var i in src) { | |
try { |
This file contains 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
Kelas = function () { | |
var c = function () { | |
if (this.initialize) { | |
this.initialize.apply(this, arguments); | |
} | |
} | |
function Extend(dst, src) { | |
for (var i in src) { | |
try { |
This file contains 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\components; | |
/** | |
* Description of SSE | |
* | |
* @author Misbahul D Munir <[email protected]> | |
* @since 1.0 | |
*/ |
This file contains 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
// di file SiteController.php | |
public function actionMessage() | |
{ | |
$sse = new \app\components\SSE(); | |
$counter = rand(1, 10); | |
$t = time(); | |
//$sse->retry(3000); | |
while ((time() - $t) < 15) { |
OlderNewer