PHP code example of tangible / object

1. Go to this page and download the library: Download tangible/object library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

tangible / object example snippets


use Tangible\DataView\DataView;
use Tangible\RequestHandler\Validators;

add_action('admin_menu', function() {
    $view = new DataView([
        'slug'   => 'contact_entry',
        'label'  => 'Contact Entry',
        'fields' => [
            'name'      => 'string',
            'email'     => 'email',
            'message'   => 'text',
            'subscribe' => 'boolean',
        ],
        'ui' => [
            'menu_label' => 'Contact Entries',
            'icon'       => 'dashicons-email',
        ],
    ]);

    $view->get_handler()
        ->add_validator('name', Validators::