问题非常简单,我正在尝试将第二部分添加到变量选择中。 dpiSchoolCode是第二部分,现在应该显示在学校名称的右侧。我该怎么办?我已经在从loadmodel抓取dpicode并进行设置。我只是不确定如何将其附加到当前的学校名称列表中。
一旦添加并确认它是正确的dpicode-学校名称,然后我需要将其隐藏,但现在我只想检查并确保它有效。会喜欢一些指导。
<select name="schoolChoice" id="schoolChoice">
<?php foreach ($schoolChoices as $schoolChoice): ?>
<?php $selected = (!empty($schoolChoice->active)) ? ' selected="selected"' : null; ?>
<option value="<?= $schoolChoice->schoolName, dpiSchoolCode; ?>"
<?= $selected;?>><?= $schoolChoice->schoolName; ?>
<?php endforeach; ?>
</select>
$schoolChoicesTable = $this->loadModel('ChooseSchools');
$schoolYear = $this->session->read('App.schoolYear');
$schoolChoices = $schoolChoicesTable->find()
->where([
'fiscalYear' => $schoolYear,
'districtCode' => 'MA',
])
;
$this->set('schoolChoices',$schoolChoices);