Skip to content

Instantly share code, notes, and snippets.

<?php
class View_Complex extends View
{
public $var_title = 'Testing';
public function var_things()
{
return Inflector::plural(get_class(new Model_Test));
}
<?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 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 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 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
require 'mustache'
class Layout < Mustache
self.template = "Header
{{{yield}}}
Footer"
end
class Index < Mustache
self.template = "The Index."
/**
* Same as fetch_all except you can pass a where clause
*
* @param array $where the where clause
* @param string $order_by a column to order on
* @param string $direction the direction to sort
* @param string $type the type of where to run
*
* @return Database_Result
*/
module Picombo
module Controllers
class Tournament < Picombo::Controllers::Template
def initialize
super
end
def index
@@template[:body] = Picombo::Stache::Tournament_Index.render
module Picombo
module Models
class User < Picombo::Model
storage_names[:default] = 'users'
property :id, Serial, :key => true
property :email, String
property :password, String
property :first_name, String
property :last_name, String
module Picombo
module Models
class Feed_Post < Picombo::Model
storage_names[:default] = 'feed_posts'
property :id, Serial, :key => true
property :content, String
belongs_to :user, :model => 'Picombo::Models::User'
end