문제

I have a page in the database. I want to have a URL like mysite.com/page_alias for the page.
How do I properly write route in laravel 4.
In kohana i did this:

Route::set('static', '<page>', array('page' => "page|page2|page3|etc"))
        ->defaults(array(
            'action' => 'index',
            'controller' => 'Static',
            'directory' => 'Index',
        ));

Thanks.
Sorry for my english.

도움이 되었습니까?

해결책

I never use Kohana but looking at its doc, if I'm right, this is the closest way to do what you used to do with Kohana.

Route::get('{page}', 'StaticController@index')->where('page', 'page|page2|page3|etc');

PS: take a look at this http://laravel.com/docs/4.2/routing (you probably have already checked the doc but in case..)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top