quick question about method and class


I just have a quick question.

I am in the z controller and would like to call y method in y object.

I have tried that way but it does not work :

So in Z controller:

y = new y;


I have the message that the method is not exists.

How can I call y methods from z controller?

$y=new Y;


Yes, I have tried that.

Here is the following code.

   public function actiondeleteLanguage()




		$cv_langue = new cv_langue;




		foreach($cv_langue as $value){		

		echo '<option value="'.$value->id_langue.'">'.$value->titre.'</option>';





But I have the following message :

cv_langue does not have a method named loadcv_langue.

The error message is clear. Your cv_langue class doesn't have a method named "loadcv_langue".

The method is exisiting that the point I do not understand…

In my cv_langue controler:

	public function loadcv_langue($id=null)




			if($id!==null || isset($_GET['id']))

				$this->_cv_langue=cv_langue::model()->findbyPk($id!==null ? $id : $_GET['id']);


				throw new CHttpException(500,'The requested cv_langue does not exist.');


		return $this->_cv_langue;


your method is defined in controller, but you are calling it on the model

Ok sorry I understand now.

Thank you Qiang!