Say Hello to Kohana 3

Kohana 3 has been released for a while. This is a redesign version of Kohana. Kohana 3 and 2 will both be in active, if you are new to Kohana, I suggest you to start with Kohana 3. The most important difference between these two version is that Kohana 3 uses a new design pattern HMVC rather than MVC as Kohana 2 is using. What is HMVC? These two articles may help you understand it:
You can download Kohana 3 here:
As usual, it’s extremely easy to install Kohana, unzip the download file, put the Kohana folder to your web server, change permissions of following folders to 777:
- application/cache
- application/logs
Finally make some changes to application/bootstrap.php:
- Change timezone
- Set the base_url
That’s it, your Kohana is ready to go. Visit your website which should be the base_url you set above, you will see the Environment Tests page:
Notice the green background text, it’s telling you to delete the install.php file in you Kohana root. And then refresh the page, you will see “hello, world!” text. Where is the text come from? Open application->classes->controller, there is a welcome.php there. Double click the file, Here is the code:
<?php defined('SYSPATH') or die('No direct script access.');
class Controller_Welcome extends Controller {
public function action_index()
{
$this->request->response = 'hello, world!';
}
} // End Welcome
This is the Welcome controller, the only thing it do is to print the text ‘hello, world!’ to the screen. You can try to output other text by change:
$this->request->response = 'hello, world!';
to:
$this->request->response = 'hello, Kohana 3! I am Zack from ZackLive.com~';
Now you’ve got your Kohana installed, try to get your hands dirty.
Some useful resource for Kohana 3:
If you’ve got any questions about Kohana 3, feel free to ask me by commenting here or post on Kohana forum.
.
.






Pingback: Zack Live