direction = $direction; } public function getHTML() { $direction = $this->direction; $fon_3 = URL::to('img/front-page/bakalavr-special/fon3_blok.png'); $educationForms = ''; foreach ($direction['educationForms'] as $key => $educationForm) { $educationForms .= $key . ', '; } $educationForms = substr($educationForms, 0, -2); $budget_places_array = array(); foreach ($direction['educationForms'] as $key => $educationForm){ $budget_places_array[$key] = $educationForm['budget_places']; } $budget_places = '
'; foreach ($budget_places_array as $key => $item){ $budget_places .= "$key - $item
"; } $period_array = array(); foreach ($direction['educationForms'] as $key => $period) { $period_array[$key] = $period['period']; } $period = '
'; foreach ($period_array as $key => $item) { $period .= "$key - $item
"; } $profiles = ''; //if (array_key_exists('educationalInstitution',$direction)) echo '+++++'; else echo '----'; //exit(); if (array_key_exists('educationalInstitution',$direction)) { foreach ($direction['educationalInstitution'] as $educationalInstitution_name => $educationalInstitution) { $profile_out = '
'; $profiles .= "

{$educationalInstitution_name}

"; foreach ($educationalInstitution as $profile_name => $profile) { foreach ($profile as $key => $value) { $profile_out .= "{$key} - {$value['budget_places']}
"; } $tmp = str_replace(' ', '', $profile_name); $profiles .= "

$profile_out
"; } }; } return "
{$direction['code']}
{$direction['name']}

{$direction['description']}

Бюджетные места:

{$profiles}
Уровень образования: {$direction['educationLevel']}


Форма обучения: $educationForms


Бюджетные места: {$budget_places}


Квота: {$direction['quota']}


Места на контракт: {$direction['paid_places']}


Стоимость платного обучения:


Период обучения (в годах): {$period}
"; } // phpcs:enable }