I
I
Ivan Ivanov2017-10-23 13:24:13
Kohana
Ivan Ivanov, 2017-10-23 13:24:13

How to make such routing in kohana 3?

It is necessary that the site opens in the following ways:

/search/surname/<surname>/name/<name>
/search/surname/<surname>
/search/name/<name>

Is it possible to organize this through one routing rule in kohana?
current rule
Route::set('search', 'search/(surname/<surname>/)(name/<name>)', array(
    'name' => '.+', 
    'surname' => '.+', 
  ))
  ->defaults(array(
        'directory'  => 'Index',
    'controller' => 'Main',
    'action'     => 'Search',
  ));

does not process
/search/surname/<surname>
neither
/search/surname/<surname>/
How to proceed?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question