PHP code example of getdevflow / custom-fields

1. Go to this page and download the library: Download getdevflow/custom-fields 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/ */

    

getdevflow / custom-fields example snippets


Field::get('field_name', $id); // default context is `content`
Field::get('field_name', $id, 'product');
Field::get('field_name', $id, 'user');

Field::gallery('field_name', $id);

Field::images('field_name', $id); // the field must be an array

Field::rows('field_name', $id); // the field must be an array

Field::raw('field_name', $id); // must be top level attribute key

[
    [
        'title' => 'Row 1',
        'description' => 'Example',
    ],
    [
        'title' => 'Row 2',
        'description' => 'Example',
    ]
]
 codex plugin:install getdevflow/custom-fields

[
    [
        '_layout' => 'hero',
        '_uuid' => 'uuid',
        'heading' => 'Welcome',
        'content' => 'Example',
    ],
    [
        '_layout' => 'gallery',
        '_uuid' => 'uuid',
        'images' => [],
    ]
]

[
    'url' => 'https://example.com/uploads/image.jpg',
    'name' => 'image.jpg',
    'mime' => 'image/jpeg',
]

[
    [
        'url' => 'https://example.com/uploads/image1.jpg',
    ],
    [
        'url' => 'https://example.com/uploads/image2.jpg',
    ]
]

style_settings

[
    'width' => '50',
    'label_color' => '#333333',
    'input_background' => '#ffffff',
    'text_color' => '#111111',
    'border_radius' => '6px',
    'font_size' => '16px',
    'google_font' => 'Inter',
]