Beispiel #1
0
 public function get_opts($opts, $name = null, $default = '')
 {
     $h = '';
     if (!array_key_exists('class', $opts)) {
         $opts['class'] = 'form-control';
     }
     foreach ($opts as $key => $value) {
         $h .= " {$key}=\"{$value}\"";
     }
     if (!is_null($name) || $default != '') {
         $h .= ' value="' . Input::get($name, $default) . '"';
     }
     return $h;
 }
Beispiel #2
0
 public function register(Container $c)
 {
     Input::loadFromEnvironment();
 }
Beispiel #3
0
 public function execute(Container $container)
 {
     // Inject route params (if any) in input
     Input::load($this->params);
     $this->mutateAction($container);
     $this->result = call_user_func_array($this->action, $this->params);
     if (is_string($this->result)) {
         $stringResult = $this->result;
         $this->result = new ClosureRenderable(function ($c) use($stringResult) {
             $c['response']->setContent($stringResult);
         });
         return $this->result;
     } else {
         if (is_object($this->result) && in_array('Vexillum\\Rendering\\RenderableInterface', class_implements($this->result))) {
             return $this->result;
         }
     }
     throw new InvalidRouteResultException();
 }