How to arrange models, views, controllers in a Kohana 3 project

Posted by Pekka on Stack Overflow See other posts from Stack Overflow or by Pekka
Published on 2010-03-14T21:48:35Z Indexed on 2010/03/14 23:25 UTC
Read the original article Hit count: 560

Filed under:
|
|
|
|

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.

I learn best by example, but 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 getting into the framework soon enough, I'm a bit concerned about arranging a healthily structured 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 not very detailed, but I don't want to cram too much information into this question. I'll be more than happy to go into more detail if needed.

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 logged in as business, and so on, and I'm just looking for how to fit the functionality into a MVC pattern and into a Kohana application structure that can be easily extended:

  • Do you know real-life, publicly accessible examples of "database-heavy" applications like directories, online communities... with a log-in area 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?

© Stack Overflow or respective owner

Related posts about php

Related posts about php5