Install Kohana on Windows
I’m new to Kohana, making this tutorial just want to do something for the community. Please let me know, if you found any mistakes. Ok, let’s cut to the chase.
I suppose you have your server installed, if not I recommand AppServ. It’s better to use the latest version of Kohana from SVN, so you might need TortoiseSVN. I create a folder called Kohana in my webroot, check out the truck folder from SVN, it’s quite easy to do it, right click, select SVN Check…

Type http://svn.kohanaphp.com/trunk in URL of repository, click ok, and wait for the download.


And then you will have three folders: application, modules and system; and three files: index.php, kohana.png, Kohana License.html. To see if Kohana is installed properly, type localhost/Kohana, you will see the welcome page:

Now you may want to do some configuration. Open config.php in /application/config/ folder, the first setting is the site domain, we are using localhost here, so just leave it as ‘/kohana/’. For the second one site protocol, we mostly use ‘http’. That’s all what we do for this moment.
I would like to do some test now. Create a test.php file in /application/controllers/, type in the fellowing codes:
<?php
/**
* Test controller
*/
class Test_Controller extends Template_Controller
{
function __construct()
{parent::__construct();
//Generate system information, you should try to comment this line to see what will the page be.
$this->profiler = new Profiler;
}function index()
{
//Set the page title.
$this->template->title = ‘Test Page’;
}
}
?>
We also need to create a template.php in /application/views/, it looks like this:
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en” lang=”en”><head>
<title><?php echo $title ?></title>
<body>
<h2><?php echo $title ?></h2>
</body>
</html>
Back to the blowser, we have visited localhost/kohana, and now we go to localhost/kohana/index.php/test, you should have a page like this:

There are only two parts in this page, the first one is the title of the page, setting by ‘$this->template->title = “Test Page”;’ and the second part is a table of some system information generated by the profiler library: ‘$this->profiler = new Profiler;’
Ok, that’s all, for further issue, you should keep an eye on my blog and Kohana official website.
.
.
-
luf
-
http://blogiii.com/zack Zack
-
Steeg
-
http://blogiii.com/zack Zack
-
http://erwinwta.blogspot.com erwin
-
http://blogiii.com/zack Zack
-
http://arhitektonas.blogspot.com George Petsagourakis




