@param null   $name
@param null   $class
@param null   $id
@param string $method
@param string $action
@param array  $attrs

@return null|string
@throws HtmlException
424760
public static function open($name = NULL,
                         $class = NULL,
                         $id = NULL,
                         $method = 'POST',
                         $action = '',
                         $attrs = array()
                         )
    {
        $tag = NULL;
        
        if($class)
            $attrs['class'] = $class;
        if($id)
            $attrs['id'] = $id;
        $attrs['method'] = $method;
        $attrs['action'] = $action;
        
        $tag .= '<form';
        $tag .= ' ' . self::parseAttrs($attrs);
        $tag .= '>';
        return $tag;
    }
184341
public function open($method, $action = '', $attr = array())
    {
        // check if they wish to send a file
        // default to post method and add the enctype needed to send files
        $method = strtolower($method);
        if ($method === 'file') {
            $method = 'post';
            $attr['enctype'] = 'multipart/form-data';
        }

        if (! in_array($method, array('post', 'get'))) {
            $method = 'post';
        }

        $attr['method'] = $method;
        $attr['action'] = $action;

        return $this->Html->tag('form', $attr);
    }
605074
public static function script($src, array $attrs = [])
    {
        $attrs = array_merge([
            'src' => $src
        ], $attrs);

        return static::tag('script', null, $attrs);
    }
164474
protected function getViewStub($method = null, $name = null)
    {
        if (in_array($name, [ $this->qualifyClass('ModelController'), $this->qualifyClass('Model/ChildController') ])) {
            if ($this->option('parent')) {
                return __DIR__.'/stubs/view.nested.model.'.$method.'.stub';
            } elseif ($this->option('model') || $this->option('resource')) {
                return __DIR__.'/stubs/view.model.'.$method.'.stub';
            }
        }

        if ($this->option('parent')) {
            return __DIR__.'/stubs/view.nested.'.$method.'.stub';
        } elseif ($this->option('model') || $this->option('resource')) {
            return __DIR__.'/stubs/view.'.$method.'.stub';
        }

        return __DIR__.'/stubs/view.stub';
    }
700577
def method_missing(id_or_class, *args, &block)
      if id_or_class.to_s =~ /(.*)!$/
        @attrs[:id] = $1
      else
        id = id_or_class
        @attrs[:class] = @attrs[:class] ? "#{@attrs[:class]} #{id}".strip : id
      end

      unless args.empty?
        if args.last.respond_to? :to_hash
          @attrs.merge! args.pop.to_hash
        end
      end

      args.push(@attrs)

      while @stream.length > @original_stream_length
        @stream.pop
      end

      if block
        @builder.tag! @sym, *args, &block
      else
        @builder.tag! @sym, *args
      end

      self
    end
760800
public function create($root, $attrs, $content = null)
    {
        $this->_buffer .= '<'.$root;
        
        if (!is_array($attrs)) {
            $content = $attrs;
            $attrs = [];
        }
        
        if ($attrs) {
            $attrs_str = [];
            foreach ($attrs as $name => $val)
                $attrs_str[] = $name . '="'.htmlspecialchars($val).'"';
            $this->_buffer .= ' ' . implode(' ', $attrs_str);
        }
        
        if (!$content) {
            $this->_buffer .= ' />';
        } else {
            $this->_buffer .= ">";
            
            if (is_string($content))
                $this->_buffer .= $content;
            elseif ($content instanceof \Closure)
                $this->_buffer .= $content();
            else
                throw new Exception\InvalidArgumentException(
                    sprintf('Expecting Closure or string as third argument, %s passed.', gettype($content))
                );
            
            $this->_buffer .= '</'.$root.'>';
        }
    }
1016614
public static function el($name = NULL, $attrs = NULL)
	{
		$el = new static;
		$parts = explode(' ', (string)$name, 2);
		$el->setName($parts[0]);

		if (is_array($attrs)) {
			$el->attrs = $attrs;

		} elseif ($attrs !== NULL) {
			$el->setText($attrs);
		}

		if (isset($parts[1])) {
			$matches = preg_match_all('#([a-z0-9:-]+)(?:=(["\'])?(.*?)(?(2)\\2|\s))?#i', $parts[1] . ' ', $matches, PREG_SET_ORDER);
			foreach ($matches as $m) {
				$el->attrs[$m[1]] = isset($m[3]) ? $m[3] : TRUE;
			}
		}

		return $el;
	}
965644
function attribute( $name )
    {
        switch ( $name )
        {
            case "name" :
            {
                return $this->Name;
            } break;

            case "multioption_list" :
            {
                return $this->Options;
            } break;
            default:
            {
                eZDebug::writeError( "Attribute '$name' does not exist", __METHOD__ );
                return null;
            }break;
        }
    }
524477
function GetHtmlAttribute($name)
        {
            if (isset($this->attributes[$name]))
                    return $this->attributes[$name];
            
            return null;
        }
37641
public function getAttribute($object, $name, array $args = array(), $type = self::ANY_CALL)
    {
        // array
        if ($type == self::ANY_CALL || $type == self::ARRAY_CALL) {

            $key = is_bool($name) || is_float($name) ? (int) $name : $name;

            if ((is_array($object) && array_key_exists($key, $object)) || ($object instanceof \ArrayAccess && isset($object[$key]))) {
                return $object[$key];
            }

            if ($type == self::ARRAY_CALL) {
                return null;
            }
        }

        // object
        if (!is_object($object)) {
            return null;
        }

        // property
        if ($type == self::ANY_CALL && isset($object->$name)) {
            return $object->$name;
        }

        // method
        $call  = false;
        $name  = (string) $name;
        $item  = strtolower($name);
        $class = get_class($object);

        if (!isset(self::$classes[$class])) {
            self::$classes[$class] = array_change_key_case(array_flip(get_class_methods($object)));
        }

        if (!isset(self::$classes[$class][$item])) {
            if (isset(self::$classes[$class]["get$item"])) {
                $name = "get$name";
            } elseif (isset(self::$classes[$class]["is$item"])) {
                $name = "is$name";
            } elseif (isset(self::$classes[$class]["__call"])) {
                $call = true;
            } else {
                return null;
            }
        }

        try {
            return call_user_func_array(array($object, $name), $args);
        } catch (\BadMethodCallException $e) {
            if (!$call) throw $e;
        }
    }
396498
public function getAttrib($name)
	{
		return isset($this->attributes[$name]) ? $this->attributes[$name] : null;
	}
1133416
public function open($action = "/", $attributes = null)
    {
        return '<form action="'.$action.'"'. (($attributes !== null) ? $this->attributes($attributes) : "") . '>';
    }
19002
public static function attr($name, $value = null)
    {
        if (is_string($name)) {
            $name = [$name => $value];
        }

        return HtmlBuilder::buildAttributes($name);
    }
45557
public function upload_form($attrib, $name, $action, $input_attr = array())
    {
        // Get filesize, enable upload progress bar
        $max_filesize = $this->upload_init();

        $hint = html::div('hint', $this->gettext(array('name' => 'maxuploadsize', 'vars' => array('size' => $max_filesize))));

        if ($attrib['mode'] == 'hint') {
            return $hint;
        }

        // set defaults
        $attrib += array('id' => 'rcmUploadbox', 'buttons' => 'yes');

        $event   = rcmail_output::JS_OBJECT_NAME . ".command('$action', this.form)";
        $form_id = $attrib['id'] . 'Frm';

        // Default attributes of file input and form
        $input_attr += array(
            'id'   => $attrib['id'] . 'Input',
            'type' => 'file',
            'name' => '_attachments[]',
        );

        $form_attr = array(
            'id'      => $form_id,
            'name'    => $name,
            'method'  => 'post',
            'enctype' => 'multipart/form-data'
        );

        if ($attrib['mode'] == 'smart') {
            unset($attrib['buttons']);
            $form_attr['class'] = 'smart-upload';
            $input_attr = array_merge($input_attr, array(
                // #5854: Chrome does not execute onchange when selecting the same file.
                //        To fix this we reset the input using null value.
                'onchange' => "$event; this.value=null",
                'class'    => 'smart-upload',
                'tabindex' => '-1',
            ));
        }

        $input   = new html_inputfield($input_attr);
        $content = $attrib['prefix'] . $input->show();

        if ($attrib['mode'] != 'smart') {
            $content  = html::div(null, $content);
            $content .= $hint;
        }

        if (rcube_utils::get_boolean($attrib['buttons'])) {
            $button   = new html_inputfield(array('type' => 'button'));
            $content .= html::div('buttons',
                $button->show($this->gettext('close'), array('class' => 'button', 'onclick' => "$('#{$attrib['id']}').hide()")) . ' ' .
                $button->show($this->gettext('upload'), array('class' => 'button mainaction', 'onclick' => $event))
            );
        }

        $this->output->add_gui_object($name, $form_id);

        return html::div($attrib, $this->output->form_tag($form_attr, $content));
    }
1313619
public function getAttribute( $name ) {
        if( key_exists( $name, $this->attrs ) ) {
            return $this->attrs[$name];
        } else {
            return null;
        }
    }
1072206
public function open(String $name = NULL, Array $_attributes = [])
    {
        $this->clearValidationSessions();

        $this->setFormName($name, $_attributes);

        $this->isEnctypeAttribute($_attributes);
       
        $this->isWhereAttribute($name);
        
        $this->isQueryAttribute();

        $this->isPreventAttribute();
        
        $this->setMethodType($_attributes);
        
        $this->createFormElementByAttributes($_attributes, $return);

        $this->isDatabaseProcessWithName($name, $return);

        $this->isCSRFAttribute($return);

        $this->_unsetopen();

        $this->outputElement .= $return;

        return $this;
    }
243468
public function getAttribute($name = null)
    {
        return is_null($name) ? $this->attributes : Arr::get($this->attributes, $name);
    }