Using form helper with PhpEngine as standalone

361 views Asked by At

I gonna use symfony form as standalone component. I wonder how can i apply PhpEngine for rendering. In official docs it only with Twig. I have found no examples how to implement it.

composer
    "symfony/form": "2.7.*",
    "symfony/validator": "2.7.*",
    "symfony/config": "2.7.*",
    "symfony/templating": "2.8.*@dev",
    "symfony/twig-bridge": "3.0.*@dev",
    "symfony/framework-bundle": "2.7.0-BETA1"

so i do something like this:

in view:
<?php echo $view['form']->start($form) ?>
<?php echo $view['form']->widget($form) ?>
<?php echo $view['form']->end($form) ?>

 in controller:
  $this->phpEngine = new PhpEngine(new TemplateNameParser(), $this->loader);
  $this->phpEngine->render($this->template, $this->container);

So renderer cannot find FormView helper. it takes no affect(( By the way component "symfony/templating" doesn't has FormHelper. After googling i have found this FormHelper

$this->phpEngine->setHelpers([new SlotsHelper(),new FormHelper($this->phpEngine)]);

0

There are 0 answers