what’s the problem with my code?
error:
layouts/header.php
<?
foreach($lesson as Lesson::getAllLessons()):
echo CHtml::link($lesson,"?r=lesson&type=".$lesson,array("title"=>$lessons)) . "<br />";
endforeach;
?>
lesson model:
<?php
class Lesson extends CActiveRecord
{
public static function model($class=__CLASS__)
{
return parent::model($class);
}
public static function isLessonInList($name)
{
return in_array($name, self::$lessons);
}
public function tableName()
{
return "lessons";
}
public static function getAllLessons()
{
return self::model()->findAll();
}
}
?>
how can i fix the fatal error?