gorriecoe / silverstripe-sreg
Simple tokenizer that allows you to use .ss template like variables in a dataobjects string.
Package info
github.com/gorriecoe/silverstripe-sreg
Type:silverstripe-vendormodule
pkg:composer/gorriecoe/silverstripe-sreg
1.2.2
2018-05-03 04:06 UTC
Requires
- silverstripe/framework: ^4.0
README
Simple tokenizer that allows you to use .ss template like variables in a dataobjects string.
Installation
Composer is the recommended way of installing SilverStripe modules.
composer require gorriecoe/silverstripe-sreg
Requirements
- silverstripe/framework ^4.0
Maintainers
Usage
class MyObject extends DataObject { private static $has_one = [ 'Relation' => 'SomeObject', 'AFallBack' => 'SomeObject', ]; public function SomeFunction() { return 'Some text'; } public function getValue() { return $this->sreg('Lorem ipsum {$Relation.Title|AFallBack.Title|Fall back text} {$SomeFunction}'); } }