function filter model
  • hi,
    I met a problem with the function filters (), it lists all the table elements
    always the new version fuelcms
    thank you
  • In the model's list_items method, add a select like so:

    public function list_items($limit = NULL, $offset = NULL, $col = 'last_updated', $order = 'desc', $just_count = FALSE)
    $this->db->select(', table.field1, table.field2...');
    $data = parent::list_items($limit, $offset, $col, $order, $just_count);
  • public function filters(){

    if (defined('FUEL_ADMIN'))
    $CI =& get_instance();

    $ds = $this->get_articles();

    $sq = array();

    foreach ($ds as $cb)
    $sq[$cb->id_type_bien] = $cb->id_type_bien;

    $filters['id_type_bien'] = array(
    'label' => 'Filter',
    'type' => 'select',
    'options' => $sq,
    'first_option' => 'Show All'

    return $filters;

    it lists all the table elements

  • Are you referring to the select options displaying all of the items or the data result being returned by the filters? I'm not sure what I'm looking at here.
  • thanks ,
    that's why I ask you to correct it, please give me the exact function
  • Sorry, but I'm unclear as to what you are asking for. Are you wanting the data results returned from the table filtered view to not display all the columns? If so, see my post above about using the select statement.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!