TIP: Use Markdown or, <pre> for multi line code blocks / <code> for inline code.
These forums are read-only and for archival purposes only!
Please join our new forums at discourse.kohanaframework.org
Kohana 3 Project Template
  • Hey Ladies and Gents

    I'm looking for a project template to kickstart some web apps.

    Basic building blocks should include:

    1. Basic Views template (Header, Footer, Main Content Body).

    2. Authentication. Including sign up, forgot password, registration, with some consideration to stop brute force attacks. Welcome email, forgot password email etc would also need to be part of the plan.

    3. Decent Error handling, as well as User "Warning / Error / Success" messages with Flash style messages similar to Rails. (not adobe Flash - Rails Flash - its totally different!)

    4. Basic Styling using Bootstrap (latest version).

    5. Contact form. Simple. Sexy, but useful.

    I have a few projects lined up, and would be great to get a solid base that kickstarts them. If you know of any source of code to share, please let me know where I can find it.

    Alternatively, would anyone be interested in contributing to this with me. In my personal capacity it has to be built either way, but If I join forces with some others, I'm sure we could get a good code base down for the community. It will also be a lot tighter than if I did it by myself ;) I have most of these pieces of the puzzle in various projects, but I'd like them to be central, organised and awesome!

    If you know of any other ingredients that would make this useful to the wider community, please let me know. I'd like to have a basic project template that includes ALL of the common ingredients found in my web apps, to speed up development. If I end up just building my own, I'll take your recommendations into consideration.

  • Take a look at our project - github.com/modulargaming

  • I like the idea. Provided bootstrap is done as optionial and not required, I think it would be a great idea. Here are some other thoughts I initially have:

    1) The ability to set a title (via $this->template->title)

    2) The ability to add stylesheets ($this->template->css[]), but obviously there'd need to be support for overrides when using things like S3. I also believe a $_minify_css option / some form of css caching would be good

    3) A security token set as a javascript variable in the document (I believe this to be good practice)

    4) Default validation object instantiated by controller's before():

    if ($this->request->method() === Request::POST)
                // Create a validation object for later
                $this->_validation = Validation::factory($this->request->post());
                // Add the token check to all post requests as a default
                $this->_validation->rule('token', 'not_empty');
                $this->_validation->rule('token', 'Security::check');

    and then in the main action, a user would add to $this->_validation, and do the ->check() themselves in the controller.

    5) I also think that body classes are useful, so perhaps a controller before, again, could set those

    6) Javascript (same as point 2)

    I was going to dive further in here, but as I'm reading through, I genuinely think that this project would be smarter if these things were done as separate modules, rather than what I started to suggest / thing. For example, your ideas could be split into:

    1) Auth_Forms (Includes sign up form, login form)

    2) Auth_Broot (protects auth from brute forcing)

    3) Emails (allows users to define emails through text files / html files / in code, and then call them using Emails::factory('user.registration')->set('Variable', 'Value')->render(), but I've always done this with views.

    4) Auth_Emails (Sends emails at certain points in the auth)

    5) Auth_Forgot_Password (adds forgot password form / functionality, perhaps intergrates with Auth_Broot and Auth_Forms)

    6) Bootstrap (Module that extends HTML and Form helpers, adding classes to the elements, but allowing a parameter for user to override the bootstrap classes used). Remarkable module idea I think.

    I haven't properly evaluated this reaction / my thoughts, but I do like the idea of more kohana 'usables', for sure.

  • Great idea - I'm not sure if I can be of any assistance, but I'll track this thread (and the Github project that might be conceived) to see if I can add something to this.

    For templating, I would go for Kostache. As a newbie, I'm quite susceptible to the authoritative voice of @zombor...

  • Thanks for the responses.

    @Curtis, I'll be checking out your project today. Looks interesting.

    @Jack, you have some interesting points. I'm not really looking at setting something with lots of configurable options (e.g. Bootstrap or no-bootstrap). I just want to put a complete project together that will kickstart people starting with Kohana or starting new projects with Kohana. All of the views / css etc could be used as is, or extended or replaced. I'm NOT trying to build an out the box app, (like wordpress), just something that will combine a few useful modules plus a bit of glue in the middle into a fully working site that can be extended into any app that the developer intends to build. I'll be looking at your comments a bit more as I build it, some of it is over my head but I'll try take it all into consideration! In a nutshell, I feel that Kohana is amazing... but takes a few too many steps to go from nothing to something (especially for newbies). This is just a bridge in the middle showing one way of putting a few pieces of the puzzle together.

    @zenlord, to be honest, I haven't seen the light with KOstache. I've read a lot of good things about it, but I still like the idea of using normal HTML for my views. I know html, everyone else knows HTML and its really easy, but I have other templating options on my list to play with.

  • Sounds like a useful thing, @dylanh. I'll be checking it out for sure. :-)

    On the front of out-of-the-box systems, is anyone working on such a thing? Is Gleez CMS where it's at? Or BDQCustom? Or Kompose? Or Kohanut?

  • @samwilson Kompose looks insane. I've got no idea if it's still being actively developed, but I'm on their mailing list anyway.

    @dylanh Yeah, I feel ya, that's why I've said that making it modular would be smart, because it means there are more parts for people to merge together. At the moment, people can get started with user logins thanks to auth, but there's little else to play with.

    Some cheeky chap has done a CRUD module, it seems: http://codecanyon.net/item/kohana-crud-data-management-system/5418804

    If there's not an open source CRUD module, I might even do one myself.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion