Call model with variable

Friends I’m new to yii and got stuck at a point…

To access a model we generally use,

Is it possible to use a variable in place of Post().

just use




$post = new Post;



if post is the model name.

Actually my model name is a variable here depending on user input…

not possible …

so use




$post = new $variable-name;



so what about the model file specified as veriable ???

as i seen user had predefine variables and model files named as predefine variables so controller will fetch particular model data …

dnt think that way ,if his model exists !!!

yes rajith, thats exactly what i said.

developer can use variable as model but the set of variable model must had exists…