$('#clicked').on ('click' , function () {
$.ajax (
{
url: "",
method: "POST",
data :
{
'name': $('#clicked').text(),
'level': 'plus',
},
success: function (data) {
alert(data);
}
if (Yii::$app->request->isAjax) {
if ($_POST['level']=='plus') {
Yii::$app->response->format = Response::FORMAT_JSON;
$level=$level+1;
$folderLevel=$folderLevel->getFolderLevel($level,$_POST['name']);
return $folderLevel;
}