/frontend/views/blog/test.phpэто наверное путь, а не url.
$this->registerJs('
$(".category-div").click(function () {
$.ajax({
url: "'.\yii\helpers\Url::toRoute(['blog/test','id'=>$someid]).'",
dataType: "html",
data: "id="+this.id,
success: function(data){
$("#conteiner").html(data);
},
error: function () {
$("#conteiner").html("ERROR");
}
});
});
');
if (flags_1 && flags_2 )
{
var form = $(this);
var data = form.serialize();
$.ajax({
url: 'ajax/model_ajax_1.php',
type: 'POST',
dataType: 'JSON',
data: data,
method:'POST',
success: function(data)
{
if (data['status'] == 'ok')
{
$('.input_clear').val('');
//$('.modal_form').css('visibility','collapse');
$('.reveal-modal-bg').fadeIn(300);
$('#modal_ok').fadeIn(300);
this.handler = setTimeout(function () {
$('.reveal-modal-bg').fadeOut(300);
$('#modal_ok').fadeOut(300);
}, 3000);
}
//else alert(data['message']);
}
})
}
return false;
});
$('#modal_ok').fadeIn(300);
alert("Форма отправлена, живите пока");
<?php
namespace common\components;
class MyComponent
{
public static function fuckMe($name)
{
return 'I fuck, '.$name;
}
}
use common\components\MyComponent;
echo MyComponent::fuckMe('Вася');