public static function form()
 {
     $args = func_get_args();
     $options = array_pop($args);
     // use GET method as default
     if (!isset($options['hash']['method'])) {
         $options['hash']['method'] = 'get';
     }
     $html = '<form' . \Slim\Views\Helpers\Helper::html_attributes($options['hash']) . '>' . "\n" . $options['fn']() . '</form>';
     return $html;
 }
Esempio n. 2
0
 public static function textarea($args, $attributes)
 {
     if (!isset($attributes['name']) && isset($args[0])) {
         // TODO: analyse context recursively
         if (Slim\Views\Lightncandy::$context->count() > 0) {
             $attributes['name'] = Slim\Views\Lightncandy::$context->top() . '[' . $args[0] . ']';
         } else {
             $attributes['name'] = $args[0];
         }
     }
     return array('<textarea' . \Slim\Views\Helpers\Helper::html_attributes($attributes) . '></textarea>', 'raw');
 }