* Fertigstellung Buchungsformular (#1321) (SternTours-CRM-API-Anbindung, Mailversand, Validierung, Dynamische Preisberechnung, Persistierung von Buchungsinformationen)

* Fehler bei der Preisberechnung behoben
* Farbschema geändert (Kevin Adametz)

git-svn-id: http://78.47.251.156/svn/dev/sterntours-3@3289 f459cee4-fb09-11de-96c3-f9c5f16c3c76
This commit is contained in:
uli 2017-02-14 11:26:49 +00:00
parent dde3b91724
commit 3a28866cd2
36 changed files with 2200 additions and 268 deletions

View file

@ -0,0 +1,72 @@
<?php
/**
* @author Ulrich Hecht <ulrich.hecht@hecht-software.de>
* @date 02/10/2017
*/
namespace AppBundle\Twig;
class AppExtension extends \Twig_Extension
{
protected $environment;
private $template;
public function __construct(\Twig_Environment $env)
{
$this->environment = $env;
}
public function getFunctions()
{
return array(
'form_field' => new \Twig_SimpleFunction('form_field', array($this, 'formField'), array(
'is_safe' => array('html')
)),
'form_field_pho' => new \Twig_SimpleFunction('form_field_pho', array($this, 'formFieldPho'), array(
'is_safe' => array('html')
)),
);
}
public function formField($form, $label = null, $opt = null)
{
$this->template = $this->environment->loadTemplate( '::default/form/helpers.html.twig' );
return $this->template->renderBlock('form_field', array(
'form' => $form,
'label' => $label,
'opt' => $opt
));
}
/**
* Form field with placeholder only
*
* @param $form
* @param null $label
* @param null $opt
*
* @return mixed
*/
public function formFieldPho($form, $label = null, $opt = [])
{
$this->template = $this->environment->loadTemplate( '::default/form/helpers.html.twig' );
return $this->template->renderBlock('form_field_pho', array(
'form' => $form,
'label' => $label,
'opt' => $opt
));
}
/**
* Returns the name of the extension.
*
* @return string The extension name
*/
public function getName()
{
return 'app_extension';
}
}