setRelationDynamic

setRelationDynamic(string $fieldName , string $relatedTable, string $relatedTitleField)

Same as setRelation but with dynamic search for the relation data. Ideal for big amount of data on the relation table.

Example

A full working example can be found here:

$crud->setTable('employees');
$crud->setSubject('Employee', 'Employees');
$crud->setRelationDynamic('officeCode','offices','city');
$crud->displayAs('officeCode','City');

$output = $crud->render();

You can see the result of the above code at the below datagrid. You can see how the functionality behaves by simply searching the dynamic field "City".