Guy Sartorelli 0f386039df
API Refactor template layer into its own module
Includes the following large-scale changes:
- Impoved barrier between model and view layers
- Improved casting of scalar to relevant DBField types
- Improved capabilities for rendering arbitrary data in templates
2024-10-11 11:31:00 +13:00

33 lines
721 B
PHP

<?php
namespace SilverStripe\View\Tests\SSTemplateEngineTest;
use SilverStripe\Dev\TestOnly;
use SilverStripe\Model\List\ArrayList;
use SilverStripe\Model\ArrayData;
use SilverStripe\Model\ModelData;
class CacheTestData extends ModelData implements TestOnly
{
public $testWithCalls = 0;
public $testLoopCalls = 0;
public function TestWithCall()
{
$this->testWithCalls++;
return ArrayData::create(['Message' => 'Hi']);
}
public function TestLoopCall()
{
$this->testLoopCalls++;
return ArrayList::create(
[
ArrayData::create(['Message' => 'One']),
ArrayData::create(['Message' => 'Two'])
]
);
}
}