0

I have real estate portal, where objects has same param:
- Deal Type: Sale, Rent, Mortage
- Object Type: Flat, Home, Office, Land
- Country, Region, City, District, Street - Room Count
- Price (min. - max.)
...
I need to creat Rewrite url
I know I must build rout in bootstrap.php
For exp, I have

Route::set('objects_list','objects_list(/page<page>)')
    ->defaults(array(
        'directory' => 'pages',
        'controller' => 'objectslist',
));

Web page has:
www.site.com/objects_list - show all objects
www.site.com/objects_list/page(2,3,4...) - paginator
This two rule is work, but how i can build this www.site.com/objects_list/rent/home/russia/...
and please fix me and tell what url is most correct.

In controller I have default method witch call all objects get_all($this->data,$this->data['sort'],$pagination->items_per_page,$pagination->offset); where $this->data - is search form array, and I think I must build url based this array.

1 Answer 1

0

For www.site.com/objects_list/rent/home/russia/ url you need to create separate Route like:

Route::set('objects_list2','objects_list/(//'), array('dealtype' => '(Sale|Rent|Mortage)')) ->defaults(array( 'directory' => 'pages', 'controller' => 'objectslist2', ));

Pay attention to define dealtype part of Route to known and only possible dealtype options to clearly match only required URLs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.