Skip to content

Instantly share code, notes, and snippets.

@graphis
Forked from lukemorton/bootstrap-example.php
Created February 9, 2011 12:54
Show Gist options
  • Save graphis/818426 to your computer and use it in GitHub Desktop.
Save graphis/818426 to your computer and use it in GitHub Desktop.
<?php
// Excerpt from bootstrap.php
Kohana::init(
array(
'base_url' => '/',
'index_file' => '', // Important
)
);
<?php
Route::set('hello', '')
->defaults(
array(
'controller' => 'hello',
)
);
<?php
Route::set('hello', '(<name>)')
->defaults(
array(
'controller' => 'hello',
)
);
<?php defined('SYSPATH') or die('No direct script access.');
class Controller_Hello extends Controller {
public function action_index()
{
$this->response->body('hello world');
}
}
<?php defined('SYSPATH') or die('No direct script access.');
class Controller_Hello extends Controller {
public function action_index()
{
$name = $this->request->param('name', 'world');
$this->response->body("hello {$name}");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment