setLanguagePath

setLanguagePath(string $languagePath)
Available from version >= 2.5.6

setLanguagePath is used in order to change the default path of the language folder. This is extremely useful when the language file of Grocery CRUD doesn't fit your needs as you may use a different dialect. You can either use the folder of the languages or the direct path for your php file. For example:

With the folder:

$crud->setLanguagePath('application/language/grocery-crud/');

or without the slash:

$crud->setLanguagePath('application/language/grocery-crud');

Of course also don't forget to also choose the preferable language. For example:

$crud->setLanguagePath('application/language/grocery-crud');
$crud->setLanguage('Greek');

With the language file directly:

You can also pick up directly the language file that you would like to have. For example:

$crud->setLanguagePath('application/language/grocery-crud/Spanish.php');

Notice: Please have in mind that if the the setLanguagePath has a direct file as a string then the setLanguage function will not work anymore.

You can also see a full example below:

$crud->setTable('customers');
$crud->setSubject('Customer', 'Customers');
$crud->columns(['customerName','phone','addressLine1','creditLimit']);

$crud->setLanguagePath('application/language/grocery-crud');
$crud->setLanguage('Spanish');

$output = $crud->render();