PHP code example of heimrichhannot / contao-be_hyperlink-bundle
1. Go to this page and download the library: Download heimrichhannot/contao-be_hyperlink-bundle 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/ */
heimrichhannot / contao-be_hyperlink-bundle example snippets
$GLOBALS['TL_DCA']['tl_*']['fields']['myHyperlink'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_*']['myHyperlink'],
'inputType' => 'hyperlink',
'eval' => array(
'text' => &$GLOBALS['TL_LANG']['tl_*']['myHyperlinkText'], // string
'linkClass' => 'tl_submit', // use this for contao's button styling
'tl_class' => 'long',
'target' => '_blank',
// the url can be specified as string, callback array ora callable function
'url' => 'http://www.example.org',
'url' => ['MyClass', 'getUrl'],
'url' => function(\DataContainer $objDc) {
return sprintf('http://www.example.org?id=%s', $objDc->id);
}
)
);