there, I have php action_events_work_time that answer:
Array
(
[error] =>
[html] => Мои трудозатраты ч.ч (433.12 | 0 | 122.51)Общие затраты ч.ч (1030.12 | 5362)
)
I have ajax request:
$.ajax({
url: '/project/event/events_work_time',
type: 'POST',
async: true,
data: {},
dataType: 'json',
success: function(resp) {
//var data = resp.upload;
if(resp.error == false){
$('#events_work_time').html(resp.html);
}else{
$('#events_work_time').html('Ошибка при загрузке');
}
}
});
But ajax answer is only
Мои трудозатраты ч.ч (433.12 | 0 | 0)
<---This var is 0???
The last variable is 0. Why??? Can someone solve this?? I use kohana framework + twig
Thank to all that wanted to help. I solved it by myself. The problem was that ajax did not sent some data to php. Just added data parameter to ajax. And changed
$this->cur_project['id']
to $_POST['project_id'];
in php
$.ajax({
url: '/project/event/events_work_time',
type: 'POST',
async: true,
data: {'project_id': "{{event}}"},
dataType: 'json',
success: function(resp) {
//var data = resp.upload;
if(resp.error == false){
$('#events_work_time').html(resp.html);
}else{
$('#events_work_time').html('Ошибка при загрузке');
}
}
});