PHP code example of aerynl / refinement

1. Go to this page and download the library: Download aerynl/refinement 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/ */

    

aerynl / refinement example snippets


$refinements = array(
	'products' => array(
		'color_id' => array(12, 13, 14)
	);
);
Refinement::updateRefinements("products_filters", $refinements);

'titles' => array(
    'products|color_id' => 'Product color',
	...
);

$new_refinements = array(
	'$table_name1' => array(
		'$table_column1' => array(
			$value1, $value2, $value3
		),
		'$table_column2' => array(
			$value1, $value2, $value3
		),
		...
	),
	...
);

$options_scheme = array(
	'parent_table' => 'products', 'join_table' => 'colors', 'filter_column' => 'color_id', 'filter_value' => 'color_name', 'additional_wheres' => array("colors.deleted_at is null")
);