PHP Classes

File: documentation/method/id/add_filter.md

Recommend this page to a friend!
  Classes of Aby Dahana   Aksara   documentation/method/id/add_filter.md   Download  
File: documentation/method/id/add_filter.md
Role: Auxiliary data
Content type: text/markdown
Description: Auxiliary data
Class: Aksara
A CodeIgniter based API and CRUD generator
Author: By
Last change: refactor: update the documentation template
Update add_filter.md
Update add_filter.md
Date: 17 days ago
Size: 1,609 bytes
 

Contents

Class file image Download

Metode ini untuk menambahkan suatu kolom filter pada formulir pencarian pada tabel

Referensi

add_filter($filter, $options)

Parameter $filter[array|string]filter yang akan ditambahkan sebagai tambahan formulir pencarian;* $options[array]opsi fallback yang akan diubah menjadi pilihan dropdown / value input.*

 

Contoh Penggunaan

$this->add_filter('language', [
    [
        'id' => 0,
        'label' => phrase('All languages')
    ], [
        'id' => 1,
        'label' => 'English'
    ], [
        'id' => 2,
        'label' => 'Bahasa Indonesia'
    ]
]);

Anda juga dapat menggunakan metode berikut secara berkelompok seperti berikut:

$this->add_filter([
    'language' => [
        'label' => phrase('Language'),
        'values' => [
            [
                'id' => 0,
                'label' => phrase('All languages')
            ], [
                'id' => 1,
                'label' => 'English'
            ], [
                'id' => 2,
                'label' => 'Bahasa Indonesia'
            ]
        ]
    ],
    'category' => [
        'label' => phrase('Category'),
        'values' => [
            [
                'id' => 0,
                'label' => phrase('Uncategorized')
            ], [
                'id' => 1,
                'label' => phrase('Sports')
            ], [
                'id' => 2,
                'label' => phrase('Foods')
            ]
        ]
    ]
]);

 

Baca Juga