1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-18 10:51:21 +02:00

Flextype Core: Shortcodes - BaseUrlShortcode added. #154

This commit is contained in:
Awilum
2019-06-18 15:37:13 +03:00
parent becccdac06
commit 841f006169

View File

@@ -0,0 +1,21 @@
<?php
/**
* @package Flextype
*
* @author Sergey Romanenko <hello@romanenko.digital>
* @link http://romanenko.digital
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flextype;
use Thunder\Shortcode\ShortcodeFacade;
use Thunder\Shortcode\Shortcode\ShortcodeInterface;
// Shortcode: [base_url]
$flextype['shortcodes']->addHandler('base_url', function () {
return \Slim\Http\Uri::createFromEnvironment(new \Slim\Http\Environment($_SERVER))->getBaseUrl();
});