I’m displaying a list of student names. When they are selected, I want to perform a behavior. I’ve made some changes to the "selectStudent’ behavior and suddenly my list of students stopped working. It reported an error accessing $student->name on line 5 below.
Here’s the original code:
<?php /* @var $student Student */
$student = $enrollment->student;
?>
<div class="view studentNameButton">
<?php echo CHtml::link(CHtml::encode($student->fullName), //Here's where the error was reported
array('selectStudent','classroomId'=>$classroom->id, 'studentId'=>$student->id)); ?>
</div>
When I added a blank line before the <div> directive, it suddenly started working. Can anyone explain why? I’m a new user so need all the help I can get.
I’m using:
Yii 1.1.6.r2877
Eclipse Helios Service Release 2
Apache 2.2 server running locally on Windows XP.