clifford.duke
clifford.duke

Reputation: 4020

Kohana 3.3 routing to subdirectory

I'm new to Kohana and am stuck with routing to a subdirectory, It keeps giving me a url not found on server.

In the bootstrap.php I have this Route defined:

Route::set('store', 'store(/<action>)')
    ->defaults(array(
        'directory'  => 'store',
        'controller' => 'main',
        'action'     => 'index',
    ));

the store controller is stored in application/classes/Controller/Store/Main.php

To test it the controller is only returning some text to the page:

<?php defined('SYSPATH') or die('No direct script access.');

class Controller_Store_Main extends Controller
{
    public function action_index()
    {
        $this->response->body('Store Main Page');
    }
}

Upvotes: 1

Views: 907

Answers (1)

biakaveron
biakaveron

Reputation: 5483

The same works for me.

  1. What Kohana version do you use? This example is for 3.3 only.
  2. Your route must be defined before default route.

Upvotes: 1

Related Questions