Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?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');
- })
- );
Add Comment
Please, Sign In to add comment