Wiki articles tagged with "search"

Showing 1-18 of 18 items.

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

Created 9 years ago by Louis Gac, updated 9 years ago by 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: 23 175 times
Version: 2.0
Category: Tips

Drills : Search by a HAS_MANY relation in Yii 2.0

Created 9 years ago by softark, updated 6 years ago by softark.

This article tries to describe the practical techniques of searching by a HAS_MANY relation using ActiveRecord of Yii 2.0.

13 0
14 followers
Viewed: 106 156 times
Version: 2.0
Category: Tutorials

How to display Dependent drop-down value using ajax call with dynamically

Created 10 years ago by Ankit Modi, updated 5 years ago by samdark.

Hi Friends, In this tutorial I write a code display dependent drop-down value using ajax call.

1 1
6 followers
Viewed: 50 582 times
Version: 1.1
Category: Tutorials

Expert's model generation with Gii

Created 10 years ago by le_top, updated 10 years ago by 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: 17 464 times
Version: 1.1
Category: Tips

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

Created 10 years ago by le_top, updated 10 years ago by 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: 11 402 times
Version: 1.1
Category: Tips

Yii2 default values for Index data Provider

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

Guys,

2 0
5 followers
Viewed: 32 103 times
Version: 2.0
Category: Tips

How to create a criteria condition for a multiple value text search i.e a "LIKE IN"

Created 10 years ago by toph, updated 8 years ago by toph.

This is a shortcut for adding a text search for multiple values i.e.

0 0
5 followers
Viewed: 55 283 times
Version: 1.1
Category: How-tos

Take more control of CGridview and model searching (related model or another controller)

Created 10 years ago by Kostas Apazidis (KonApaz), updated 10 years ago by CeBe.

Suppose you have an Application in Yii that manages hotels each one has many customers.

2 0
6 followers
Viewed: 43 437 times
Version: 1.1
Category: How-tos

Search a file size range in CGridView

Created 11 years ago by CrazyCat, updated 11 years ago by 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: 12 116 times
Version: Unknown (update)
Category: Tips

Adding a date range search for CGridView the easy way

Created 11 years ago by mikewalen, updated 11 years ago by 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: 42 716 times
Version: 1.1
Category: Tips

Drills : Search by a HAS_MANY relation in Yii 1.1

Created 11 years ago by softark, updated 6 years ago by softark.

Sometimes we get lost trying to search by a HAS_MANY relation using CActiveRecord or CActiveDataProvider in Yii 1.1. This article is a series of drills that try to describe the practical techniques of searching by a HAS_MANY relation.

22 0
27 followers
Viewed: 77 939 times
Version: 1.1
Category: Tutorials

CGridView, CListView and CActiveDataProvider

Created 12 years ago by softark, updated 11 years ago by softark.

CGridView (or CListView) together with CActiveDataProvider is a very powerful combination of the built-in tools of Yii. But how do they work together to accomplish their fantastic functions? And what are you expected to do to use them and to customize their behaviors? This article explains the very basics of them.

26 0
33 followers
Viewed: 144 881 times
Version: 1.1
Category: Tutorials

Searching and Sorting by Count of Related Items in CGridView

Created 12 years ago by softark, updated 9 years ago by softark.

class Post extends CActiveRecord {

...

} ` When you list Authors in grid you would like to print the count of posts in column, allow sorting on this column and probably filtering by the count.

21 0
40 followers
Viewed: 60 427 times
Version: 1.1
Category: How-tos

Adding search to Yii blog example (using Zend Lucene)

Created 13 years ago by dckurushin, updated 11 years ago by klammeraffe.
  • add under runtime directory, a new one call it search, it will be used for the index files that Zend Lucene will create. Make sure it is writable!
29 1
47 followers
Viewed: 89 750 times
Version: 1.1
Category: Tutorials

Filter / Search with CListView

Created 13 years ago by JohnPollard, updated 11 years ago by JohnPollard.

This is what I did. Its the EASIEST solution that I know of. I just reused the advanced search done in CGridView.

22 0
26 followers
Viewed: 55 911 times
Version: 1.1
Category: How-tos

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

Created 13 years ago by Mukke, updated 13 years ago by 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: 38 153 times
Version: 1.1
Category: Tips

Using standard filters in CGridView custom fields

Created 13 years ago by GOsha, updated 13 years ago by jwerner.

In this article I'll try to explain how to use standard quick search fields in CGridView with customized columns.
For example:
We have a record in a database with field switch having 0 or 1 values. After that we want a user to see on or off instead 1 or 0.
So we do the usual thing:

<?php $this->widget('zii.widgets.grid.CGridView', array(
//.....
array(
    'name'=>'...
14 0
16 followers
Viewed: 74 687 times
Version: 1.1
Category: How-tos

Adding Yii Search to Your Browser Search Box

Created 14 years ago by qiang, updated 6 years ago by 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: 64 920 times
Version: all
Category: Tips