views:

54

answers:

1

I'm trying to create a custom route like:
search/result/city/p1/state/p2/zip/p3/min/p4/max/p5/bed/p6/bath/p7/cats/p8/dogs/p9/parking/p10
Where search is the controller and result the action p1-p10 are variables.

+1  A: 

You want a route to match that? Here goes...

Route::set('crazy_route', 'search/result/city/<p1>/state/<p2>/zip/<p3>/min/<p4>/max/<p5>/bed/<p6>/bath/<p7>/ (and so forth)', array())
 -> defaults(
       // set your defaults
       array(
        'controller' => 'seach',
        'action'    => 'result' 
      )
    )

Of course, I don't know what should be optional, or what should be stored as overflow, so you may need to modify it.

I would also recommend using more descriptive placeholder names then p1 for example.

alex
I did the following:<br/>Route::set('search', 'search/result/city/<city>/state/<state>/zip/<zip>/min/<min>/max/<max>/bed/<bed>/bath/<bath>/cats/<cats>/dogs/<dogs>/parking/<parking>'), array()) -> defaults( array( 'controller' => 'seach', 'action' => 'result' ) ));And put it in the bootstrap.php before the default route. Now every page comes up blank, like the view is missing, but I get no error. Any clue?
pigfox