We are attempting to send out emails from within a command line script
and the content of the email is in a twig template. We tried this
approach which is the code I found within the sf2 controller
renderView method:

                $rendered = $this->container->get('templating')-
>render('ProgramBundle:Frontend:daily-email.twig', array(
                    'user' => $user,
                ));

However, we get this error:

PHP Fatal error:  Call to a member function getRequestFormat() on a
non-object in /data/sites/exercise-deploys/
2010-12-31_19-29-32_codebase/exercise/cache/prod/classes-ba4e4.php on
line 524

Fatal error: Call to a member function getRequestFormat() on a non-
object in /data/sites/exercise-deploys/2010-12-31_19-29-32_codebase/
exercise/cache/prod/classes-ba4e4.php on line 524


Any ideas how to render a twig template from within a command line
script with sf2?

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to