Skip to content

Instantly share code, notes, and snippets.

require 'mustache'
class Layout < Mustache
self.template = "Header
{{{yield}}}
Footer"
end
class Index < Mustache
self.template = "The Index."
<?php defined('SYSPATH') or die('No direct script access.');
/**
* Acts as an object wrapper for HTML output with embedded PHP, called "views".
* Variables can be assigned with the view object and referenced locally within
* the view.
*
* @package Kohana
* @category Base
* @author Kohana Team
* @copyright (c) 2010 Kohana Team
<?php defined('SYSPATH') or die('No direct script access.');
/**
* Acts as an object wrapper for output with embedded PHP, called "views".
* Variables can be assigned with the view object and referenced locally within
* the view.
*
* @package Kohana
* @category Base
* @author Kohana Team
* @copyright (c) 2008-2009 Kohana Team
<?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;
}
<?php defined('SYSPATH') or die('No direct script access.');
/**
* Acts as an object wrapper for HTML pages with embedded PHP, called "views".
* Variables can be assigned with the view object and referenced locally within
* the view.
*
* @package Kohana
* @category Base
* @author Kohana Team
* @copyright (c) 2008-2009 Kohana Team
<?php
class View_Complex extends View
{
public $var_title = 'Testing';
public function var_things()
{
return Inflector::plural(get_class(new Model_Test));
}