简体   繁体   中英

Learning Kohana

I'm a reasonably intelligent guy and have been involved in a lot of stuff like HTML, PHP, Java, C#, C, C++, assembly, and so on and so forth. All in all I think that there's very little I don't have basic understanding of, though of course I'm by no means an expert in all the subjects, it's simply to illustrate that I'm not as green as I may very well sound.

Now, the thing is that I've been instructed to learn about the Kohana framework, in order to help with some web development at work. Well, that's all well and good, especially as I'm kinda tired of spending my time correcting other peoples HTML/CSS mess. To do some proper coding for a change would indeed be nice.

So I set out to learn, what I thought would be easy as pie, and not only did I think so, I was told so. Imagine my disappointment when after making an effort, I still didn't have the most basic understanding of the subject.

The documentation is unsatisfying to say the least, and I have yet to find a proper explanation of the subject as a whole.

In short, I understand close to nothing, and the more effort I make, the more confused I get. I honestly don't know where to begin and end.

I can't really tell you what I need to get going, as my understanding isn't even significant enough to know what I need to learn. I suppose a tutorial explaining, step by step, how to make something useful, would be in order, but I've been unable to find anything in the many hours I've spent searching.

This is my last way out, and the only possibly solution I could come up with. To ask you how you initially learned to use Kohana.

I do apologize for the lack of an actual question, but I do hope that you'll do your best to help anyway.

Kohana isn't a "one size fits all" framework. We don't mandate how you do things. Therefore, tutorials don't apply the same way they do in other frameworks. The docs are there to tell you how to use the provided classed, but not really to tie them all together.

There's example applications on github if you'd like to look. Here's a few of mine:

The best source of information is...the source.

When I learned Ko3, documentation didn't exist at all, read the source starting from index, bootstrap, request, etc. and continued as long as there was something I couldn't understand. Altough it took some time to get through everything, eventually I got to know it as if I wrote it, so yeah - I think this is the best way.

Anyways, there are many sources for learning Kohana today:

How I learned Kohana? By just diving in, mess around and reading and understanding the framework code. When I started with Kohana, version 3.0 was about to be released and there was no documentation like there is now..

I am a person who refused to use frameworks for personal reasons until i was forced to learn one because it was what the company i was applying for required me to learn before i'd get accepted. The framework was Kohana version 2.3.4, and i was given one week to complete a project using the framework as well as other requirements given to me by the head developer.

Upon googling, this is the best resource i found at the time: Kohana 101.pdf

I totally totally agree with you, DOCUMENTATION SUCKS!!! But because of this i completed my project in 4 days (thankfully), meaning its very easy to absorb kohana with this resource. In the part where you're already doing mysql queries, you will encounter 1 query that doesn't work, i'll leave the easter egg hunting to you ;) Don't worry the solution is very basic :D

I very much strongly suggest you learn Kohana version 2.x first before 3.x But if you want to jump learning Kohana version 3.x this link might be your best reference.

If you have questions folks at kohana forums can help you ALOT, they're really nice people. Some bite, but not eat you at least :D

I now love frameworks especially especially kohana because of alot of things. Hope this helps! :D

The best place to learn about kohana is:

1 Read the source code

2 Join #kohana on freenode

如果你真的有这种经验,你应该没有这篇文章的问题: http//kerkness.ca/wiki/doku.php

There is actually not much to understand, altough you should have a good understanding of some terms and subjects. First of all, please make sure you know something about MVC (Model-View-Controller). It's not a difficult topic, you should understand it in half an hour or an hour. I assume, basing on your programming experience, that the term OOP shouldn't be sounding strange to you, otherwise, please start there.

Then just start with creating some controllers, just echoing stuff ( echo "inside controller xyz"; ), then including views. Place all controllers and views in the application/classes/controller/ and application/views/ directories. The Kohana documentation at http://kohanaframework.org/3.2/guide/kohana/mvc/controllers and http://kohanaframework.org/3.2/guide/kohana/mvc/views should help you out here.

Now a little bit of a tricky part; Routes. They are quite powerful and important in Kohana, alltough after you get used to them you won't using them that much. Please read http://kerkness.ca/kowiki/doku.php?id=routing:routing_basics .

Then now is probably a good time to try out the models and the ORM module.

Now please be aware of the cascading file system and be sure to understand it properly. This will make it possible to extend anything, from your own code to all Kohana core features. It'll also makes it possible to write your modules, with their respective routes, controllers, views, models, configuration files etc.

If you've understood the above you've grasped the basics of Kohana. Now it's all up to experience, trying out, asking us guys on SO and your own imagination. But I cannot stretch enough that a proper understanding of HMVC and OOP is probably the most important. Then you'll only need to get used to Kohana.

I have released a vagrant development environment with a base checkout of Kohana 3.3.1 installed. That could be a quick way to get up and running. The best way to learn is to just dive right in. Hopefully this can help get you in the pool quicker, so to speak.

Intro to Vagrant with Kohana with Zen Kommerce

I think the best place to start is the guide page on request flow . Kohana is basically an HTTP request handler with some fancy class and config file autoloading. Personally, this is what I like most about it.

Because the request handler lives in index.php , if you want to respond to URLs without that string in them, you need to use the example .htaccess file to instruct your webserver to redirect requests to that file.

You need to also get your head around MVC if you've not used it before; it's mostly about separating the code which does the important work from the code which just prints out HTML.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM