Я получаю следующую ошибку:
Примечание (8): неопределенное смещение: 47 [APP / Template \ CoursesEnrolled \ view.ctp, строка 75]
Я попытался отладить строку, но я застрял с тем, что делать.
Мой view.ctp выглядит так:
$modulesEnrolled = Cake\Utility\Hash::combine($coursesEnrolled->courses_enrolled_modules,
'{n}.course_module_id','{n}');
// debug($modulesEnrolled);
$allModulesCompleted = true;
if (!empty($coursesEnrolled->course->course_modules)): ?>
<div class="">
<table class="table table-bordered table-hover" id="toggletable">
<thead>
<tr>
<th><?= __('Title') ?></th>
<th><?= __('Type') ?></th>
<th class="actions"><?= __('Actions') ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($coursesEnrolled->course->course_modules as $courseModules): ?>
<tr>
<td><?= h($courseModules->title) ?></td>
<td><?= h($courseModules->type) ?></td>
<td class="actions">
<?php
if($allModulesCompleted && $modulesEnrolled[$courseModules->id]['status'] == 'Pending') { //this is line 75
$allModulesCompleted = false;
}
Любая помощь будет принята с благодарностью.