PHP code example of pstaender / kirby-uri-field

1. Go to this page and download the library: Download pstaender/kirby-uri-field 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/ */

    

pstaender / kirby-uri-field example snippets


return [
    'oblik.linkField' => [
        'options' => [
            'url',
            'page'
        ],
        'settings' => [
            'popup' => [
                'label' => 'External Link'
            ]
        ]
    ]
];

return [
    'oblik.linkField.settings' => false
];

$link = $page->myfield()->toLinkObject();

echo $page->myfield()->toLinkObject();

echo $page->myfield()->toLinkObject()->href();

echo $link->type();     // page
echo $link->value();    // home
echo $link->text();     // My Text
echo $link->popup();    // true
echo $link->hash();     // heading-1