PHP Classes

File: site/demos/form-markdown.php

Recommend this page to a friend!
  Packages of Boss Ibrahim Mussa   Caelrik   site/demos/form-markdown.php   Download  
File: site/demos/form-markdown.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: 483 bytes
 

 

Contents

Class file image Download
<?php

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

return Form::make('post')
    ->action('/posts')
    ->add(
        Field::text('title')->required(),
        Field::markdown('body', 'Body')
            ->required()
            ->value("## What's new\n\nCaelrik now has a **Markdown** field:\n\n- a toolbar\n- a preview")
            ->help('Markdown: **bold**, _italic_, [links](https://example.com), lists and quotes.'),
    )
    ->submit('Publish');