where should i define filter functions for router ?

7 months ago

thcom
Member | 55
+
0
-

hi, i try to learn about rountig
everything is ok but have only one problem

where should i define the filter functions filterInFunc and filterOutFunc

<?php

$route = new Route('<presenter>/<action>/<id>', [
	'presenter' => [
		Route::VALUE => 'Homepage',
		Route::FILTER_IN => 'filterInFunc',
		Route::FILTER_OUT => 'filterOutFunc',
	],
	'action' => 'default',
	'id' => null,
]);

?>

thank you !

7 months ago

CZechBoY
Member | 3572
+
0
-

You can define anonymous function or where you want… only restriction is that the function must be callable.

7 months ago

thcom
Member | 55
+
0
-

great !!

i found solutuion here

https://forum.nette.org/…zi-v-routeru

answer for my second question about database in router too

many thanks !!!