Skip to content

Commit

Permalink
ENH Update code to reflect changes in template layer (#287)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli authored Oct 30, 2024
1 parent e9378fc commit 883471c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Controllers/ModuleInitialisationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
use Exception;
use SilverStripe\Core\Manifest\Module;
use SilverStripe\Model\ArrayData;
use SilverStripe\View\SSViewer;
use SilverStripe\View\SSTemplateEngine;
use SilverStripe\View\ViewLayerData;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
Expand Down Expand Up @@ -148,8 +149,8 @@ protected function initFeaturesPath(OutputInterface $output, Module $module)
);

// Create dummy feature
$featureContent = ArrayData::create([])
->renderWith(__DIR__.'/../../templates/SkeletonFeature.ss');
$engine = SSTemplateEngine::create(__DIR__.'/../../templates/SkeletonFeature.ss');
$featureContent = $engine->render(ViewLayerData::create([]));
file_put_contents($fullPath.'/placeholder.feature', $featureContent);
}

Expand Down Expand Up @@ -184,7 +185,8 @@ protected function initClassPath(OutputInterface $output, Module $module, $names
'Namespace' => $fullNamespace,
'ClassName' => $class,
]);
$classContent = $obj->renderWith(__DIR__.'/../../templates/FeatureContext.ss');
$engine = SSTemplateEngine::create(__DIR__.'/../../templates/FeatureContext.ss');
$classContent = $engine->render(ViewLayerData::create($obj));
file_put_contents($classPath ?? '', $classContent);

// Log
Expand Down

0 comments on commit 883471c

Please sign in to comment.