Skip to content

Instantly share code, notes, and snippets.

@graphis
Forked from lukemorton/controllerSLASHexample.php
Created November 4, 2012 21:06
Show Gist options
  • Save graphis/4013781 to your computer and use it in GitHub Desktop.
Save graphis/4013781 to your computer and use it in GitHub Desktop.
<?php defined('SYSPATH') or die('No direct script access.');
class Controller_Example extends Controller {
public function action_index()
{
$this->request->response = new View_Example;
// or $this->response->body(new View_Example); in K3.1
}
}
<!doctype html>
<html>
<head>
<title>{{title}}</title>
</head>
<body>
<h1>{{title}}</h1>
</body>
</html>
<?php defined('SYSPATH') or die('No direct script access.');
class View_Example extends Kostache {
public $title = 'Page title';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment