Fixes to routing
This commit is contained in:
parent
a893527d77
commit
5b1e7aeb22
@ -124,9 +124,12 @@ Kohana::modules(array_merge(Kohana::modules(),Config::modules()));
|
|||||||
/**
|
/**
|
||||||
* Enable specalised interfaces
|
* Enable specalised interfaces
|
||||||
*/
|
*/
|
||||||
Route::set('sections', '<directory>/<controller>/(<action>(/<id>(/<sid>)))',
|
Route::set('sections', '<directory>/<controller>(/<action>(/<id>(/<sid>)))',
|
||||||
array(
|
array(
|
||||||
'directory' => '('.implode('|',Kohana::config('config.method_directory')).')'
|
'directory' => '('.implode('|',Kohana::config('config.method_directory')).')'
|
||||||
|
))
|
||||||
|
->defaults(array(
|
||||||
|
'action' => 'index',
|
||||||
));
|
));
|
||||||
|
|
||||||
// Static file serving (CSS, JS, images)
|
// Static file serving (CSS, JS, images)
|
||||||
@ -134,14 +137,13 @@ Route::set('default/media', 'media(/<file>)', array('file' => '.+'))
|
|||||||
->defaults(array(
|
->defaults(array(
|
||||||
'controller' => 'welcome',
|
'controller' => 'welcome',
|
||||||
'action' => 'media',
|
'action' => 'media',
|
||||||
'file' => NULL,
|
|
||||||
));
|
));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the routes. Each route must have a minimum of a name, a URI and a set of
|
* Set the routes. Each route must have a minimum of a name, a URI and a set of
|
||||||
* defaults for the URI.
|
* defaults for the URI.
|
||||||
*/
|
*/
|
||||||
Route::set('default', '<controller>(/<action>(/<id>))', array('id' => '[a-zA-Z0-9_.-]+'))
|
Route::set('default', '(<controller>(/<action>(/<id>)))', array('id' => '[a-zA-Z0-9_.-]+'))
|
||||||
->defaults(array(
|
->defaults(array(
|
||||||
'controller' => 'welcome',
|
'controller' => 'welcome',
|
||||||
'action' => 'index',
|
'action' => 'index',
|
||||||
|
@ -17,9 +17,6 @@ class Controller_Welcome extends Controller_TemplateDefault {
|
|||||||
if (! Kohana::config('config.appname'))
|
if (! Kohana::config('config.appname'))
|
||||||
Request::current()->redirect('guide/app');
|
Request::current()->redirect('guide/app');
|
||||||
|
|
||||||
if (! Auth::instance()->logged_in())
|
|
||||||
Request::current()->redirect('login');
|
|
||||||
|
|
||||||
Block::add(array(
|
Block::add(array(
|
||||||
'title'=>'Welcome to lnApp (public)!',
|
'title'=>'Welcome to lnApp (public)!',
|
||||||
'subtitle'=>'Using lnApp',
|
'subtitle'=>'Using lnApp',
|
||||||
|
Reference in New Issue
Block a user