Hello, I have used gii crud generator to generate the admin view.
In CGridview I have used ‘category.name’ to display a relation between to tables. When I use relations the search-functionality doesn’t work, is there an easy way to handle this?
In advanced search, there’s nothing special to do if you use Gii. All you need is changing maybe the type of attributes’ inputs for the related models in the search form.
Gii generates all input fields as text fields. For instance, taking your category.name example, I suppose you have a Category model, and categoryId is the foreign key. So you’ll have something like that in _search.php form: