Skip to content

method_field

Description

This function generates an HTML hidden input field containing the spoofed value of the form's HTTP verb.

Usage

<?php

use Qubus\Support\HtmlString;

use function Codefy\Framework\Helpers\method_field;

function method_field(string $method): HtmlString;

Parameters

$method (string) (required) Spoofed value.

Return Value

(string) The hidden input field.

Example

<form method="POST">
    <?=\Codefy\Framework\Helpers\method_field('put');?>
</form>

Result

<form method="POST">
    <input type="hidden" name="_method" value="PUT" />
</form>