Skip to content

Instantly share code, notes, and snippets.

@riaf
Created May 21, 2010 02:53
Show Gist options
  • Save riaf/408395 to your computer and use it in GitHub Desktop.
Save riaf/408395 to your computer and use it in GitHub Desktop.
<?php
// 雰囲気こんな感じ。
// 実際はファイル分けたりしてる
class HogeController
{
public function index($b) {
return $b->provide('fuga');
// return $this->phpt('index');
}
}
use blanka\Router,
blanka\response\Ok,
blanka\container\ContainerBuilder,
blanka\plugin\PHPTemplate;
$cb = new ContainerBuilder;
$cb->bind('fuga')->toValue('xxx');
$cb->bind('controller')->to('HogeController');
Blanka::app($cb->build())
->load(new PHPTemplate(__DIR__. '/templates', 'html'))
->respond(Router::it()
->{'/ :index'}('@controller::index')
->{'/test :test'}(function($b) {
return $b->provide('fuga');
})
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment