mirror of
https://github.com/netzmacht/contao-leaflet-maps.git
synced 2026-01-18 05:15:16 +01:00
Fix api inconsistency for Contao 3.5 (See #37).
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package dev
|
||||
* @author David Molineus <david.molineus@netzmacht.de>
|
||||
* @copyright 2015 netzmacht creative David Molineus
|
||||
* @license LGPL 3.0
|
||||
* @filesource
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Netzmacht\Contao\Leaflet\Frontend\Helper;
|
||||
|
||||
/**
|
||||
* This class is a helper to replace insert tags.
|
||||
*
|
||||
* @package Netzmacht\Contao\Leaflet\Frontend\Helper
|
||||
*/
|
||||
class InsertTagReplacer
|
||||
{
|
||||
/**
|
||||
* Replace insert tags with their values.
|
||||
*
|
||||
* @param string $buffer The text with the tags to be replaced.
|
||||
* @param boolean $cache If false, non-cacheable tags will be replaced.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function replace($buffer, $cache = true)
|
||||
{
|
||||
if (version_compare(VERSION, '3.5', '<')) {
|
||||
$frontendApi = new FrontendApi();
|
||||
|
||||
return $frontendApi->replaceInsertTags($buffer, $cache);
|
||||
}
|
||||
|
||||
$replacer = new \InsertTags();
|
||||
return $replacer->replace($buffer, $cache);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user