forked from Snck3rs/contao-leaflet-maps
Fix the alias generator. Do not use -.
This commit is contained in:
@@ -135,8 +135,7 @@ $container['leaflet.alias-generator'] = $container->share(
|
||||
$filters = [
|
||||
new ExistingAliasFilter(),
|
||||
new SlugifyFilter($fields),
|
||||
new SuffixFilter(),
|
||||
new UnderscoreFilter(false)
|
||||
new SuffixFilter(false),
|
||||
];
|
||||
|
||||
$validator = new UniqueDatabaseValueValidator(
|
||||
@@ -145,7 +144,7 @@ $container['leaflet.alias-generator'] = $container->share(
|
||||
$aliasField
|
||||
);
|
||||
|
||||
return new FilterBasedAliasGenerator($filters, $validator, $dataContainerName, $aliasField);
|
||||
return new FilterBasedAliasGenerator($filters, $validator, $dataContainerName, $aliasField, '_');
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package netzmacht
|
||||
* @author David Molineus <david.molineus@netzmacht.de>
|
||||
* @copyright 2016 netzmacht David Molineus. All rights reserved.
|
||||
* @filesource
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Netzmacht\Contao\Leaflet\Alias;
|
||||
|
||||
use Netzmacht\Contao\Toolkit\Data\Alias\Filter;
|
||||
|
||||
/**
|
||||
* Class UnderscoreFilter
|
||||
*
|
||||
* @package Netzmacht\Contao\Leaflet\Alias
|
||||
*/
|
||||
class UnderscoreFilter extends Filter\AbstractFilter
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function repeatUntilValid()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function apply($model, $value, $separator)
|
||||
{
|
||||
return str_replace('-', '_', $value);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user