Beispiel #1
0
 function __construct($value, $options = array())
 {
     $this->value = (string) $value;
     $this->http_only = Utils::array_val($options, 'http_only', $this->http_only);
     $this->secure = Utils::array_val($options, 'secure', $this->secure);
     $this->domain = Utils::array_val($options, 'domain', $this->domain);
     $this->path = Utils::array_val($options, 'path', $this->path);
     $this->max_age = Utils::array_val($options, 'max_age', $this->max_age);
 }
Beispiel #2
0
 public function render($template, $locals = array(), $options = array())
 {
     $layout = Utils::array_val($options, 'layout', $this->options['default_layout']);
     $status = Utils::array_val($options, 'status', 200);
     $content_type = Utils::array_val($options, 'content-type', 'text/html');
     $locals['request'] = $this->request;
     $view = new View($template, $layout, $this->options['view_path']);
     $this->renderText($view->render($locals), $content_type, $status);
 }