PHP code example of ludmanp / typicms-pageoptions

1. Go to this page and download the library: Download ludmanp/typicms-pageoptions 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/ */

    

ludmanp / typicms-pageoptions example snippets


<x-pageoptions-admin-form :model="$model" />

{!! BootForm::text(__('Description'), 'options[description]') !!}
{!! TranslatableBootForm::text(__('Phone number'), 'options[phone][number]') !!}

<x-pageoptions-image :model="$model" name="preview_image_id" label="Preview image"/>
<x-pageoptions-image :model="$model" name="phone.icon_id" label="Phone icon"/>

<x-pageoptions-file :model="$model" name="specification" label="Specification"/>

{{ $pageOptions->present()->option('phone') }}

{{ $pageOptions->present()->optionTranslated('company.name') }}

{{ $pageOptions->present()->optionTranslated('company.name', 'en') }}


<img src="{{ $pageOptions->present()->optionsImage('contact.image') }}"
    alt="{{ optional($pageOptions->present()->optionsFile('contact.image'))->alt_attribute ?? 'Contacts' }}"/>


$pageOptions->present()->optionsFile('contact.file')

<a href="{{ optional($pageOptions->present()->optionsFile('contact.file'))->url }}">File</a>
bash
php artisan page-options:install
bash
php artisan vendor:publish --tag="page-options-migrations"
php artisan migrate
bash
php artisan vendor:publish --tag="typicms-pageoptions-views"