Home Ask Login Register

Developers Planet

Your answer is one click away!

arulraj February 2016

How to change the root in bootstrap (PHP)

I am using kohana 3.2.(PHP) I need to reset the xyz.com/ar/contoller/method/argument. It is working fine.

Route::set('default', '(<country_param>(/<controller>(/<action>(/<id>(/<method>)))))')
->defaults(array('controller' => 'auctions','action'  => 'live','method' => NULL));

Now I need to xyz.com/ar/modules/controller/method/argument. I will changed the root.

    Route::set('default', '(<country_param>(/<user_param>(/<controller>(/<action>(/<id>(/<method>))))))')
->defaults(array('controller' => 'auctions','action'  => 'live','method' => NULL));

But it is not working. Can you advise?


Yurich February 2016

Maybe you need define pattern of variables

Route::set('new_default', '(<country_param>(/<user_param>(/<controller>(/<action>(/<id>(/<method>))))))')
            'controller' => 'auctions',
            'action'  => 'live',
            'method' => NULL,
            'country_param' => '[a-zA-Z0-9_]+',
            'user_param' => '[a-zA-Z0-9_]+',

and don't forget, every route must has unique name.

Post Status

Asked in February 2016
Viewed 1,598 times
Voted 5
Answered 1 times


Leave an answer

Quote of the day: live life