PHP Classes

File: site/demos/form-key-value.php

Recommend this page to a friend!
  Packages of Boss Ibrahim Mussa   Caelrik   site/demos/form-key-value.php   Download  
File: site/demos/form-key-value.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Caelrik
Build Web user interface from PHP components
Author: By
Last change:
Date: 8 days ago
Size: 569 bytes
 

 

Contents

Class file image Download
<?php

use Caelrik\Ui\Components\Form;
use Caelrik\Ui\Components\Form\Field;

return Form::make('webhook')
    ->action('/webhooks')
    ->add(
        Field::text('url', 'Endpoint URL')->required(),
        Field::keyValue('headers', 'Request headers')
            ->value(['Content-Type' => 'application/json'])
            ->keySuggestions(['Accept', 'Authorization', 'Content-Type', 'User-Agent'])
            ->keyValueLabels(key: 'Header', add: 'Add header')
            ->help('Sent with every call. A header is used once.'),
    )
    ->submit('Save webhook');