Wiki articles in category Tips tagged with "search"

Showing 1-8 of 8 items.

Building a search GET request with scenarios ; calling a SearchModel from URLs...

Created 11 years ago by Louis Gac Louis Gac, updated 11 years ago by Louis Gac Louis Gac.

Search Models are a very elegant and powerful way to build an Active Data Provider. If you use them a lot, you'll quickly need to use scenarios, which will lead you to a very DRY Controller code.

0 0
2 followers
Viewed: 27 178 times
Version: 2.0
Category: Tips

Expert's model generation with Gii

Created 11 years ago by le_top le_top, updated 11 years ago by le_top le_top.

Efficient coding with Yii implies efficient use of the code generator. This article shares the personalised Gii templates that were built starting from the standard templates proposed by AweGen.

1 0
2 followers
Viewed: 20 261 times
Version: 1.1
Category: Tips

Search scenario (CGridView, etc.): avoid default values from database as search condition.

Created 11 years ago by le_top le_top, updated 11 years ago by le_top le_top.

Yii has a neat "trick" that will assign default values to new CActiveRecords. When performing a search() though, this is pretty annoying as they automatically apply as filter values.

1 0
2 followers
Viewed: 12 850 times
Version: 1.1
Category: Tips

Yii2 default values for Index data Provider

Created 12 years ago by CTala CTala, updated 12 years ago by CTala CTala.

Guys,

2 0
5 followers
Viewed: 34 657 times
Version: 2.0
Category: Tips

Search a file size range in CGridView

Created 12 years ago by CrazyCat CrazyCat, updated 12 years ago by CrazyCat CrazyCat.
  1. Create an Active Record Behavior that builds the criteria for the search() method and attach it to your model
  2. Modify the search() method of the model to merge the behavior's criteria in with the rest of the searchable attributes
2 0
2 followers
Viewed: 13 921 times
Version: Unknown (update)
Category: Tips

Adding a date range search for CGridView the easy way

Created 13 years ago by mikewalen mikewalen, updated 12 years ago by mikewalen mikewalen.
  1. Create an Active Record Behavior that builds the criteria for the search() method and attach it to your model
  2. Modify the search() method of the model to merge the behavior's criteria in with the rest of the searchable attributes
  3. Modify the _search form view to add the date range inputs
6 0
11 followers
Viewed: 45 552 times
Version: 1.1
Category: Tips

Search method of a model for filters when using dates - unixtimestamp in database

Created 15 years ago by Mukke Mukke, updated 15 years ago by jwerner jwerner.

I ran into a problem and on irc we worked it out. Since there is a lack on information on filters in genral i thought i'd start sharing all my findings, might be usefull for other people.

10 0
11 followers
Viewed: 40 771 times
Version: 1.1
Category: Tips

Adding Yii Search to Your Browser Search Box

Created 15 years ago by qiang qiang, updated 8 years ago by CeBe CeBe.

The official Yii project site now supports OpenSearch. This means you can customize your browser's search box to enable direct search of the content in yiiframework.com. For example, by entering a Yii class name in the browser's search box, the corresponding class API page will be shown in the browser.

25 0
6 followers
Viewed: 70 102 times
Version: all
Category: Tips