/** * */ public function upload() { if ($this['request']->checkMethod(HTTP\POST)) { $file = $this['request']->get('foobar[foo][bar]', 'file'); return $this['response'](HTTP\OK, Inkwell\View::create('html', ['staple' => 'tests/upload_show.html'], ['file' => $file])); } else { return $this['response'](HTTP\OK, Inkwell\View::create('html', ['staple' => 'tests/upload_get.html'])); } }
/** * Compiles this view * * @access public * @return string The view compiled to a string */ public function make() { if (!$this->head) { $this->head = new self($this); } $this->compile(); if (!$this->parent) { $this->head->compile(); } $this->setCurrentFile(!preg_match(REGEX\ABSOLUTE_PATH, $this->template) ? $this->rootDirectory . DS . $this->template . '.' . $this->type . '.php' : $this->template . '.' . $this->type . '.php'); $view = $this->buffer(function ($app) { include $this->currentFile; }); $this->head = NULL; return $view; }
/** * */ public function main() { return $this['response'](HTTP\OK, Inkwell\View::create('html', ['staple' => 'home.html'])); }