Question on model object creation


When you create a new model object, for an example :

$model = new MyCustomModel(‘search’);

I don’t quite understand the functionality in the parenthesis and the word ‘search’. What is it’s use?

It is called “scenario”. See Working with Forms: Creating Model | The Definitive Guide to Yii 1.1 | Yii PHP Framework

1 Like

So this scenario executes a query?

This adds to the explanation

1 Like