Problem with the variable $model

Hi people,

I make a application, with a administration module. I used the Gii to generate all the controllers, models and views from module, but i can’t make the module work.

Always i try run some view from administration module, this message is showed to me: Undefined variable: model

I already search in every structure of the framework something about this variable, but don’t find nothing clear.

Hope you help.

Thank.

Big Hug.

Code, please.

We’ve run out of psychic people…

You need to pass the variable to the view, like:


$this->render('view', array('model' => $model));

But post some code.

In each day of life, we used some sort of symbols and attributes to recognize a particular element of the world.

We, used, for example, water, as a word to indicate and make it understood for others about the liquid with some specific properties.

Like the same way, in programming and in the specific part of the code, we use something to represent an object and by this, we get its properties and attributes.

Here $model is a variable that has the value of the object of any type. It can be a class, structure or just a string or array.

if we have the following code




$model=Users::model()->findAll();



Then, here $model represents an Object of Type Class which is inherited by CActiveRecord, for example.

So, $model could be anything, a variable with no value, an object some class, structure etc.

Hope you get the idea of it.