Raczkuje w temacie Kohany i mam taki problem.
Gdy tworze akcje dla kontrolera z jednym parametrem wszystko dziala jak nalezy, ale gdy dodaj juz drugi, wywala mi blad:
Kohana_Request_Exception [ 0 ]: Unable to find a route to match the URI: home/podstrona/pierwszy_parametr/drugi_param
SYSPATH\classes\kohana\request.php [ 674 ]
669 }
670
671 // No matching route for this URI
672 $this->status = 404;
673
674 throw new Kohana_Request_Exception('Unable to find a route to match the URI: :uri',
675
array(':uri' => $uri));676 }
677
678 /**
679 * Returns the response as the string representation of a request.
1.
SYSPATH\classes\kohana\request.php [ 230 ] ť Kohana_Request->__construct(arguments)
0
string(45) "/home/podstrona/pierwszy_parametr/drugi_param"
225
226 // Remove all dot-paths from the URI, they are not valid
227 $uri = preg_replace('#\.[\s./]*/#', '', $uri);
228
229 // Create the instance singleton
230 Request::$instance = Request::$current = new Request($uri);
231
232 // Add the default Content-Type header
233 Request::$instance->headers['Content-Type'] = 'text/html; charset='.Kohana::$charset;
234 }
235
2.
APPPATH\bootstrap.php [ 110 ] ť Kohana_Request::instance(arguments)
0
string(45) "/home/podstrona/pierwszy_parametr/drugi_param"
105 {
106 /**
107 * Execute the main request using PATH_INFO. If no URI source is specified,
108 * the URI will be automatically detected.
109 */
110 $request = Request::instance($_SERVER['PATH_INFO']);
111
112 try
113 {
114 // Attempt to execute the response
115 $request->execute();
3.
DOCROOT\index.php [ 103 ] ť require(arguments)
kod akcji:
public function action_podstrona($param, $param2)
{
echo 'Witam jestem kontrolerem podstrony. <br/>Przyjąłem 2 parametry:
<ul>
<li>Pierwszy: '.$param.'</li>
<li>Drugi: '.$param2.'</li>
</ul>';
}
Znalazłem rozwiązanie w pliku application/bootstrap.php trzeba bylo zmienic ustawienia Route::set('default', '(<controller>(/<action>(/<id>)))'), na Route::set('default', '(<controller>(/<action>(/<id1>(/<id2>))))')
Trochę historii...