make date filter by two periods of date

Hey, anybody help me ? I used this tutorial : to make the way to search by date range. but, I have a trouble, here is the trouble : Parse error: syntax error, unexpected ‘unset’ (T_UNSET), expecting function (T_FUNCTION) . So, please help me :) thank you

You should be able to see which line of code is the reason for the parse error.

I have been put the code in search function in controller. But, I got a new problem about : Trying to get property of non-object

The line of code is :

'value' => Yii::app()->request->cookies['from_date']->value