|
DataFilter
DataFilter syntax
Phase-Implementation Data Filter Syntax
sampleusing source, the filter can build a where clause only on fields of "artcles" table
$filter = new datafilter_library();
$filter->label = 'Article Filter';
$filter->source('articles');
$filter->field('input','title','Title')->attributes(array('style' => 'width:170px'));
$filter->field('radiogroup','public','Public')->options(array("y"=>"Yes", "n"=>"No"));
$filter->buttons('reset','search');
$filter->build();
sample 2using db object instead source(), the filter can build a where clause also on joined tables/fields $filter = new datafilter_library();
$filter->label = 'Article Filter';
$filter->db->select("articles.*, authors.*");
$filter->db->from("articles");
$filter->db->join("authors","authors.author_id=articles.author_id","LEFT");
$filter->field('input','title','Title')->attributes(array('style' => 'width:170px'));
$filter->field('radiogroup','public','Public')->options(array("y"=>"Yes", "n"=>"No"));
$filter->buttons('reset','search');
$filter->build();properties
methods$filter->source($source)
$filter->field($type, $name, $label)
$filter->field($type, $name, $label)->attributes($attributes)
$filter->field($type, $name, $label)->options($options)
$filter->buttons($button1[,$button2...])
$filter->build() build filter, fill $filter->output | ||||||||||||||||||||||||||||||||||||
► Sign in to add a comment