PHP code example of sudhaus7 / shortlink
1. Go to this page and download the library: Download sudhaus7/shortlink 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/ */
sudhaus7 / shortlink example snippets
$url = 'https://google.com/';
$shortener = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\SUDHAUS7\Shortcutlink\Service\ShortlinkService::class);
$shortener->setUrl($url);
$shortlink = $shortener->getShorturlWithDomain();
$url = 'https://google.com/';
$shortener = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\SUDHAUS7\Shortcutlink\Service\ShortlinkService::class);
$shortener->setUrl($url);
$shortener->setFeuser(42);
$shortlink = $shortener->getShorturlWithDomain();