public function defaultAction() { // In the tax rule template we use the TaxCreationForm. // // The TaxCreationForm require the TaxEngine, but we cannot pass it from the Parser Form plugin, // as the container is not passed to forms by this plugin. // // So we create an instance of TaxCreationForm here (we have the container), and put it in the ParserContext. // This way, the Form plugin will use this instance, instead on creating it. $taxCreationForm = $this->createForm(AdminForm::TAX_CREATION); $this->getParserContext()->addForm($taxCreationForm); return parent::defaultAction(); }
public function defaultAction() { // In the tax rule template we use the TaxCreationForm. // // The TaxCreationForm require the TaxEngine, but we cannot pass it from the Parser Form plugin, // as the container is not passed to forms by this plugin. // // So we create an instance of TaxCreationForm here (we have the container), and put it in the ParserContext. // This way, the Form plugin will use this instance, instead on creating it. $taxCreationForm = new TaxCreationForm($this->getRequest(), 'form', array(), array("tax_engine" => $this->container->get('thelia.taxEngine'))); $this->getParserContext()->addForm($taxCreationForm); return parent::defaultAction(); }