Get Property Category Dropdwon List

Hi

All i am new in yii and need some help

i wrote a function

public function getCateygoryList()

{


		$c= new CDbCriteria;


		$c->select = 'catId, catName';


		$c->from = 'af_categories';


		$c->order = 'catName ASC';


		$category =	Categories::model()->findAllByPk($c);


		return $category;


}

in category model when i call this function to property form to create category dropdown list like

<div class="row">

	&lt;?php echo &#036;form-&gt;labelEx(&#036;model,'fkcategroyid'); ?&gt;


	&lt;?php /*?&gt;&lt;?php echo &#036;form-&gt;textField(&#036;model,'fkcategroyid'); ?&gt;&lt;?php */?&gt;


	  &lt;?php echo &#036;form-&gt;dropDownList(&#036;model,'fkcategroyid', &#036;model-&gt;categories-&gt;getCateygoryList()); ?&gt;


	&lt;?php echo &#036;form-&gt;error(&#036;model,'fkcategroyid'); ?&gt;


&lt;/div&gt;

it show error

Property "Tblproperty.categories" is not defined.

Thanks in advance.

you should use

[color=#1C2837][size=2]$model->getCateygoryList()[/size][/color]

[color=#1C2837][size=2]

[/size][/color]

[color=#1C2837][size=2]NOT[/size][/color]

[color=#1C2837][size=2]

[/size][/color]

[color=#1C2837][size=2]$model->categories->getCateygoryList()[/size][/color]