What does this code do?

I just started at a new company that has a semi-developed Yii app. The following snippets of code are for an auto-complete form. The ‘value’ section crashes the app. I commented out the line, and everything seems to work.

What does the ‘value’ do, what is it for, and what do you guys think the person before me wanted to do with this line?




                         //name of the html field that will be generated


                         //replace controller/action with real ids


             'max'=>10, //specifies the max number of items to display


                         //specifies the number of chars that must be entered

                         //before autocomplete initiates a lookup


             'delay'=>500, //number of milliseconds before lookup occurs

             'matchCase'=>false, //match case when performing a lookup?

                         //any additional html attributes that go inside of

                         //the input field can be defined here




Lookup the initial value for the input field of the widget.

You will need to have an instance of Company (named $model) defined in the view.

Also read about AR in the guide


Ahhh, thanks. With that info, I’m guessing the other guy didn’t check if the value was set. The form is used for creating new contacts and editing existing ones. Makes sense now. Thanks again.

It seems like they should have set the model and attribute variables instead of name and value.