GeneratorBc22.php 724 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace Sonata\AdminBundle\Tests\Fixtures\Generator;
  3. use Sonata\AdminBundle\Generator\AbstractBcGenerator;
  4. class GeneratorBc22 extends AbstractBcGenerator
  5. {
  6. protected function render($skeletonDir, $template, $parameters)
  7. {
  8. if ($skeletonDir === array('path/to/templates') && $template === 'test.html.twig' && $parameters === array('foo' => 'bar')) {
  9. return 'Result OK';
  10. }
  11. return 'Result invalid';
  12. }
  13. protected function renderFile($skeletonDir, $template, $target, $parameters)
  14. {
  15. if ($this->render($skeletonDir, $template, $parameters) === 'Result OK' && $target === 'target_file') {
  16. return true;
  17. }
  18. return false;
  19. }
  20. }