Welcome Guest, Not a member yet? Register   Sign In
when I set routes with add and post, It's not work
#1

(This post was last modified: 09-07-2021, 08:42 AM by asrahi.)

Hi!
I was setting $routes like this,
But it's not work
I expected, if I connect "test.com/board" then call Board:list
and I try to submit form POST in "test.com/board", as I know it's call BoardConfusedearch.

I was trying to modify my code to priority, as, and something else...
but it's not work too

filnaly I figure out, if Im trying to use "get" instead of "add", then It's work..  Huh
I couldn't understand well
plz tell me this problem

Thank you


PHP Code:
$routes->group('board',function($routes){
 
$routes->add('(:any)/view/(:num)''Board::read/$1/$2');
 
$routes->add('(:any)/read/(:num)''Board::read/$1/$2');
 
$routes->add('(:any)/read/(:num)/(:any)''Board::read/$1/$2/$3', ['as'=>'board_read']);

 
$routes->add('(:any)/write''Board::write/$1/$2');
 
$routes->add('(:any)/write/(:any)''Board::write/$1/$2', ['as'=>'board_write']);

 
$routes->add('(:any)/edit/(:num)''Board::edit/$1/$2');
 
$routes->add('(:any)/edit/(:num)/(:any)''Board::edit/$1/$2/$3', ['as'=>'board_edit']);

 
$routes->add('(:any)/closed''Board::block/$1');
 
$routes->add('(:any)/closed/(:any)''Board::block/$1', ['as'=>'board_block']);

 
$routes->add('(:any)/del/(:num)''Board::del/$1/$2', ['as'=>'board_del']);

 
$routes->post('(:any)/post''Board::post/$1', ['as'=>'board_post']);
 
$routes->post('(:any)/replyPost''Board::replyPost/$1', ['as'=>'board_reply']);

 
$routes->post('(:any)''Board::search/$1',['priority'=>1]); //예약조회 등등
 
$routes->add('(:any)''Board::list/$1',['as'=>'board_list''priority'=>10]); //리스트

});
$routes->addRedirect('board','/'); 

Reply


Messages In This Thread
when I set routes with add and post, It's not work - by asrahi - 09-07-2021, 08:31 AM



Theme © iAndrew 2016 - Forum software by © MyBB