MetaModels / attribute_alias

The alias attribute
GNU Lesser General Public License v3.0
0 stars 6 forks source link

add static field to use as fixed "prefix" #16

Closed zonky2 closed 7 years ago

zonky2 commented 7 years ago

add static field at first to use as fixed "prefix" e.g. wie work with integer values like year or id...

in this time the alias add "id" if we use year 2017 to "id-2017-...." - after this we can use "year-2017-...."

discordier commented 7 years ago

Sounds reansonable, yet we should default it to id- to stay "compatible" with Contao

zonky2 commented 7 years ago

e.g. from xtra

$strAlias = standardize(strip_tags($replaceEvent->getBuffer()));
if ('' !== $this->get('prefix')) {
    $strAlias = $this->get('prefix') . substr($strAlias, 3);
}
discordier commented 7 years ago

Remember to check for existence of 'id-' first!

zonky2 commented 7 years ago

implemented in https://github.com/MetaModels/attribute_alias/pull/19