Wiki

Articles tagged with "search"X
Displaying 1-10 of 18 result(s).

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

Created 2 years ago by Louis GacTips0 comments – viewed 8,763 times – ( +1 / -1 ) – version 2.0
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.
tags: search, get, Scenarios

Drills : Search by a HAS_MANY relation in Yii 2.0

Created 2 years ago by softarkTutorials4 comments – viewed 50,988 times – ( +19 / -1 ) – version 2.0
This article tries to describe the practical techniques of searching by a HAS_MANY relation using ActiveRecord of Yii 2.0.

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

Created 3 years ago by Ankit ModiTutorials4 comments – viewed 31,907 times – ( +3 / -3 ) – version all
Hi Friends, In this tutorial I write a code display dependent drop-down value using ajax call.

Expert's model generation with Gii

Created 3 years ago by le_topTips0 comments – viewed 8,773 times – ( +3 / -1 ) – version 1.1
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.

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

Created 3 years ago by le_topTips1 comment – viewed 5,933 times – ( +1 / -1 ) – version 1.1
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.

Yii2 default values for Index data Provider

Created 3 years ago by CTalaTips3 comments – viewed 17,577 times – ( +4 / -1 ) – version 2.0
Guys,

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

Created 3 years ago by tophHow-tos2 comments – viewed 36,204 times – ( +1 / -2 ) – version 1.1
This is a shortcut for adding a text search for multiple values i.e.

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

Created 3 years ago by Kostas Apazidis (KonApaz)How-tos5 comments – viewed 31,706 times – ( +5 / -1 ) – version 1.1
Suppose you have an Application in Yii that manages hotels each one has many customers.

Search a file size range in CGridView

Created 4 years ago by CrazyCatTips0 comments – viewed 6,955 times – ( +2 / -1 )
Working on a report system of files transfert, I had to let the users simply find files by size. I didn't want to have two fields, I prefer a simple text input, with "human syntax".

Adding a date range search for CGridView the easy way

Created 4 years ago by mikewalenTips6 comments – viewed 31,702 times – ( +12 / -2 ) – version 1.1
After a lot of research, everything I found on adding date range searching to a CGridView advanced search form seemed to involve adding two new public variables (e.g. $date_from, $date_to), 'safe' rules for the new variables, and a rather chunky if/elseif/else check in the search() method. This probably isn't a hassle for most, but because many of the tables in my database contain two or three and sometimes four date columns (e.g. date_created, date_modified, date_deleted etc.), it meant I was having to add up to eight public variables, the corresponding safe rules, and modifying the search() criteria for each date attribute. So, I set about creating a better way and I thought I'd share my work with the community.