Skip to content

Instantly share code, notes, and snippets.

@zombor
Created May 20, 2010 03:06
Show Gist options
  • Save zombor/407141 to your computer and use it in GitHub Desktop.
Save zombor/407141 to your computer and use it in GitHub Desktop.
<?php
class View_Complex extends Kostache
{
public $title = 'Testing';
public function loggedin_status()
{
return Auth::logged_in() ? 'logged in as '.Auth::instance()->account->username : NULL;
}
public function things()
{
return Inflector::plural(get_class(new Model_Test));
}
public function tests()
{
return AutoModeler::factory('test')->fetch_all();
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>{{title}}</title>
</head>
<body>
<h1>{{title}}</h1>
{{loggedin_status?}}<p>{{loggedin_status}}</p>{{/loggedin_status?}}
<p>Here are all my {{things}}:</p>
<ul>
{{#tests}}
<li><strong>{{id}}:</strong> ({{name}}:{{value}})</li>
{{/tests}}
</ul>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment