How to arrange models, views, controllers in a new Kohana 3 project
- by Pekka
I'm looking at how to set up a mid-sized web application with Kohana 3. I have implemented MVC patterns in the past but never worked against a "formalized" MVC framework so I'm still getting my head around the terminology - toying around with basic examples, building views and templates, and so on.
I'm progressing fairly well but I want to set up a real-world web project (one of my own that I've been planning for quite some time now) as a learning object.
Example-based documentation is a bit sparse for Kohana 3 right now - they say so themselves on the site. While I'm not worried about learning the framework soon enough, I'm a bit at a loss on how to arrange a healthy code base from the start - i.e. how to split up controllers, how to name them, and how to separate the functionality into the appropriate models.
My application could, in its core, be described as a business directory with a main businesses table.
Businesses can be listed by category and by street name.
Each business has a detail page.
Business owners can log in and edit their business's entry.
Businesses can post offers into an offers table.
I know this is pretty vague, I'll be more than happy to go into more detail on request.
Supposing I have all the basic functionality worked out and in place already - list all businesses, edit business, list businesses by street name, create offer, and so on, and I'm just looking for how to fit the functionality into a Kohana application structure that can be easily extended:
Do you know real-life, publicly accessible examples of applications built on Kohana 3 where I could take a peek how they do it?
Are there conventions or best practices on how to structure an extendable login area for end users in a Kohana project that is not only able to handle a business directory page, but further products on separate pages as well?
Do you know application structuring HOWTOs or best practices for Kohana 3 not mentioned in the user guide and the inofficial Wiki?
Have you built something similar and could give me some recommendations?