PHP code example of studiomitte / live-search-extended

1. Go to this page and download the library: Download studiomitte/live-search-extended library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

studiomitte / live-search-extended example snippets


$configuration = new \StudioMitte\LiveSearchExtended\Configuration\Table('tx_news_domain_model_news');
$configuration
    // Provide the field name and an icon identifier
    ->addField(
        (new \StudioMitte\LiveSearchExtended\Configuration\Field('datetime', 'actions-clock'))
            ->setSkipIfEmpty(true)
            ->setPrefixLabel(false)
    )
    ->addField(
        (new \StudioMitte\LiveSearchExtended\Configuration\Field('teaser', 'actions-document'))
            ->setSkipIfEmpty(true)
            ->setPrefixLabel(false)
    )
    ->persist();

$GLOBALS['TCA']['sys_category']['ctrl']['live_search_extended'] = [
    'fields' => [
        'parent' => [
            'icon' => 'mimetypes-x-sys_category',
        ],
    ],
];

$GLOBALS['TCA']['sys_template']['ctrl']['live_search_extended'] = [
    'fields' => [
        // _count_constants is a computed field
        '_count_constants' => [
            'icon' => 'form-number',
            // As the label can't be taken from TCA as the field is not there provided, a custom label can be set
            'label' => 'Count Constants',
            'skipIfEmpty' => false,
        ],
    ],
];