Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form Theme issue... #4

Closed
gyalamanchi opened this issue Nov 14, 2012 · 4 comments
Closed

Form Theme issue... #4

gyalamanchi opened this issue Nov 14, 2012 · 4 comments

Comments

@gyalamanchi
Copy link

Hi,

I get the error below when trying to send the form theme to the twig template

The parameter "fos_user.template.theme" must be defined.

Resulting from this code below:

    return $this->container->get('templating')->renderResponse('MHOVmpBundle:Registration:register_vmp_patient.html.twig', array(
        'form' => $form->createView(),
        'theme' => $this->container->getParameter('fos_user.template.theme'),
    ));

Also, if in the twig file I try to call {% form_theme form theme %} I also get an error saying that the variable theme is not defined.

Does the FOSUserBundle latest dev-master lead to this issue?

@leopro
Copy link
Member

leopro commented Nov 28, 2012

    return $this->container->get('templating')->renderResponse('MHOVmpBundle:Registration:register_vmp_patient.html.twig', array(
        'form' => $form->createView(),
        'theme' => $this->container->getParameter('fos_user.template.theme'),
    ));

you grab this code from fosUser < 1.3 isn't it?

@gyalamanchi
Copy link
Author

Yes. I thank you for your help. The symfony 2.1 usage with FOS User Bundle I believe. They are no longer supporting that form_theme concept and saying you need to use translation domain. I guess I could still make my own partial twig like form.html.twig or something and create a label translator. I did see this excellent link on making your own translator that can work very easily with the FOS User. http://sf.khepin.com/2012/01/form-label-translation-in-symfony-2/

@leopro
Copy link
Member

leopro commented Nov 28, 2012

can I close the issue?

@gyalamanchi
Copy link
Author

Yes, thank you.

@leopro leopro closed this as completed Nov 28, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants