tags:

views:

331

answers:

1
+1  A: 

I think you'll need to use the modules folder.

A module is like a mini Kohana application, for example, a simple module might have

/modules/first_module/...

 config/
 classes/controller/
 classes/model/
 views/

However if that isn't what you want, just follow the same directory structure above under the application folder.

Update

Okay, so if you want a book set of controllers, you may lay it out like so (if you wanted them in sub folders)... (example only...)

controllers/books/base.php

class Controller_Books_Base extends Controller {


}

controllers/books/fiction.php

class Controller_Books_Fiction extends Controller_Books_Base {


}

And a route like so in bootstrap.php

Route::set('books_fiction', 'fiction-books/<action>/<id>', array('action' => '(create|read|update|delete)', 'id' => '\d+')
->defaults(array(
'controller' => 'Books_Fiction'
));

Some example classes for Books and Authors.

class Model_Book {
    // crud functions
}

class Model_Author {
    // crud functions
}

class Controller_Book {
    public function view($id) {
        $book = Model::factory('Model_Book')->get($id);
        $this->template->bookDetails = $book;  
    }
}

That will hopefully get you started.

alex
It wasn a good idea to use "submodul" as a sample name cause it's not a module in the kohana-way. It is just a "part" of the application.How to deal with st. like this:classes/books/controller/articles.phpclasses/authors/controller/articles.php
fabian