Fatal Error Call To A Member Function Findall() On A Non-Object In...

HI guys, i am new here.

I am new to YII , and I just got problem .

I am creating a dropdownlist in my form at view , the data in dropdownlist retrieved from database.

I am using this code

<div class="row">


  echo CHtml::activeLabel($model,'Kategori');




  echo CHtml::activeDropDownList(




  array('empty'=>'--pilih kategori--'));



But I got this error message : "fatal error call to a member function findall() on a non-object in blablabla…"

What did i have done wrong ? I am very stuck here, I really need help from u guys :)


The variable $model you have passed to the view is not an object.

What is the code of you controller action?

I have already figured out this problem ,

my shame… I must declare the object first.

Hehe thanks btw :D