open form tag using model

@param   Entity  $model
@param   string  $url
@param   array   $attributes
@return  Tag
352334
public function model(Entity $model, $url, array $attributes = [])
    {
        $this->model = $model;

        $tag = $this->open($url, $attributes);
        return $tag;
    }
796325
public function begin_tag($tag, $attributes = null) {
        // TODO: chek the tag name is valid
        $pre = $this->level ? "\n" . str_repeat(' ', $this->level * 2) : ''; // Indent
        $tag = $this->casefolding ? strtoupper($tag) : $tag; // Follow casefolding
        $end = $this->nullcontent ? ' /' : ''; // Tag without content, close it

        // Build attributes output
        $attrstring = '';
        if (!empty($attributes) && is_array($attributes)) {
            // TODO: check the attr name is valid
            foreach ($attributes as $name => $value) {
                $name = $this->casefolding ? strtoupper($name) : $name; // Follow casefolding
                $attrstring .= ' ' . $name . '="'.
                    $this->xml_safe_attr_content($value) . '"';
            }
        }

        // Optional xml schema definition (level 0 only)
        $schemastring = '';
        if ($this->level == 0 && !empty($this->xmlschema)) {
            $schemastring .= "\n    " . 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' .
                             "\n    " . 'xsi:noNamespaceSchemaLocation="' . $this->xml_safe_attr_content($this->xmlschema) . '"';
        }

        // Send to xml_output
        $this->write($pre . '<' . $tag . $attrstring . $schemastring . $end . '>');

        // Acumulate the tag and inc level
        if (!$this->nullcontent) {
            array_push($this->opentags, $tag);
            $this->level++;
        }
        $this->lastwastext = false;
    }
389757
protected function htmlInput($name, $value, $attributes)
    {
        return Form::radio($name, $value, in_array($value, (array) $this->value, true), $attributes);
    }
21552
public function seeRecord($model, $attributes = [])
    {
        $record = $this->findRecord($model, $attributes);
        if (!$record) {
            $this->fail("Couldn't find $model with " . json_encode($attributes));
        }
        $this->debugSection($model, json_encode($record));
    }
375568
public function create(string $content, $url, array $attributes = []) : string
    {
        return $this->make(new HrefSettings([
            'content'   => $content,
            'url'       => $url,
            'attributes'=> $attributes,
        ]));
    }
1354038
public function decorateHtmlTag($tag, array $attributes)
	{
		if (! $tag instanceof HtmlTag) {
			return null;
		}

		foreach ($attributes as $name => $value) {
			$tag->setAttribute($name, $value);
		}

		return $tag;
	}
1299172
public function generateTag($tag, $attributes, $closeTag = true)
    {
        $openPattern = replace_variables($this->openTagPattern, compact('tag'));
        $external = '';

        if (in_array($tag, $this->voidTags) && !empty($this->voidTagPattern) && $this->voidTagPattern != $this->openTagPattern) {
            $openPattern = replace_variables($this->voidTagPattern, compact('tag'));
        }

        if (array_key_exists($this->externalKey, $attributes)) {
            $external = $attributes[$this->externalKey];
            unset($attributes[$this->externalKey]);
        }

        $html = replace_variables($openPattern, ['attr' => associative_implode('=', ' ', $attributes)]);

        if (!in_array($tag, $this->voidTags)) {
            $html .= $external;

            if ($closeTag) {
                $html .= $this->closeTag($tag);
            }
        }

        return $html;
    }
1253555
public function createElement($tag, $attributes = null)
    {
        $node = parent::createElement($tag);
        $text = false;
        if (is_string($attributes)) {
            $node->setAttribute('class', $attributes);
        } else {
            if (is_array($attributes)) {
                foreach ($attributes as $key => $value) {
                    if ($key == 'text') {
                        $node->appendChild($this->createTextNode($value));
                        $text = true;
                    } else {
                        if (!is_null($value)) {
                            $node->setAttribute($key, $value);
                        }
                    }
                }
            }
        }
        if (!$text && !in_array($tag, ['img', 'br', 'input'])) {
            $node->appendChild($this->createTextNode(''));
        }
        return $node;
    }
1057009
public function uneditableField($model, $attribute, $htmlOptions = array())
    {
        return $this->createInput(TbHtml::INPUT_TYPE_UNEDITABLE, $model, $attribute, $htmlOptions);
    }
296144
public function replaceTags($model)
    {
        if (isset($model->attributes)) {
            foreach ($model->attributes as $key => $attribute) {
                if (in_array($key, $this->dataAttributes)) {
                    $val = Yii::$app->formatter->asDatetime($model->{$key}, 'short');
                } else {
                    $val = $model->{$key};
                }

                $this->subject = str_replace('{' . $key . '}', $val, $this->subject);
                $this->user_subject = str_replace('{' . $key . '}', $val, $this->user_subject);
                $this->text = str_replace('{' . $key . '}', $val, $this->text);
                $this->user_text = str_replace('{' . $key . '}', $val, $this->user_text);
            }
        }

        $table = EmailDetailView::widget([
            'model' => $model,
            'attributes' => $model::$emailAttributes
        ]);

        $this->text = str_replace('{table}', $table, $this->text);
        $this->user_text = str_replace('{table}', $table, $this->user_text);

    }
459849
public function link($url, $title = null, $attributes = [], $secure = null, $escape = true)
    {
        $url = $this->url->to($url, [], $secure);

        if (is_null($title) || $title === false) {
            $title = $url;
        }

        if ($escape) {
            $title = $this->entities($title);
        }

        return $this->toHtmlString('<a href="' . $this->entities($url) . '"' . $this->attributes($attributes) . '>' . $title . '</a>');
    }
915158
public function checkBoxRow($model, $attribute, $htmlOptions = array())
	{
		return $this->inputRow(CiiInput::TYPE_CHECKBOX, $model, $attribute, null, $htmlOptions);
	}
1154807
public function renderField(Model $model, $attribute, array $settings = [])
    {
        $fieldOptions = ArrayHelper::getValue($settings, 'fieldOptions', []);
        $field = $this->field($model, $attribute, $fieldOptions);

        if (($label = ArrayHelper::getValue($settings, 'label')) !== null) {
            $field->label($label, ArrayHelper::getValue($settings, 'labelOptions', []));
        }
        if (($hint = ArrayHelper::getValue($settings, 'hint')) !== null) {
            $field->hint($hint, ArrayHelper::getValue($settings, 'hintOptions', []));
        }

        $type = ArrayHelper::getValue($settings, 'type', static::INPUT_TEXT);
        $this->prepareField($field, $type, $settings);

        return $field;
    }
1177370
public function urlField($model, $attribute, $htmlOptions = array())
    {
        return $this->createInput(TbHtml::INPUT_TYPE_URL, $model, $attribute, $htmlOptions);
    }
1008475
public function radioButtonRow($model, $attribute, $htmlOptions = array())
	{
		return $this->inputRow(CiiInput::TYPE_RADIO, $model, $attribute, null, $htmlOptions);
	}
840979
public function simple($url, array $attributes = [], $model = null)
    {
        $method = Arr::get($attributes, 'method', 'POST');
        $this->attributes(array_merge($attributes, [
            'url'    => $url,
            'method' => $method,
        ]));
        $this->with($model);
        return $this;
    }
587211
public function tags($baseUrl, $attributes)
    {
        $html = '';
        foreach($this->files as $file)
        {
            $file = $baseUrl . str_replace($this->publicPath, '', $file);
            $html .= $this->tag($file, $attributes);
        }

        return $html;
    }