gorriecoe/silverstripe-sreg

Simple tokenizer that allows you to use .ss template like variables in a dataobjects string.

Maintainers

Package info

github.com/gorriecoe/silverstripe-sreg

Homepage

Type:silverstripe-vendormodule

pkg:composer/gorriecoe/silverstripe-sreg

Statistics

Installs: 137

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

1.2.2 2018-05-03 04:06 UTC

This package is auto-updated.

Last update: 2026-03-01 00:24:38 UTC


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}');
    }
}