Hi,you need a properly initialized controller to do this. Just creating a new instance and feeding it a context is not going to work. However, creating new instances of core framework classes is something you rarely need to to - if you find yourself doing it, you're probably doing something wrong.
the proper way would be:$container = $this->getContext()->getController()- >createExecutionContainer('Mailer', 'Auth.ForgotPass', $rd, 'html');
$response = $container->execute(); $html = $response->getContent();This is from the top of my head, so be aware of typos and the like, but you should get the general idea.
cheers felix On Feb 26, 2009, at 1:35 PM, Liutauras wrote:
Still get problems problems :/This is my full code for now, and i dont know if this code is redundantor no? This is working but maybe it can be written a littele shorter $e = new AgaviExecutionContainer(); $e->initialize($this->context);$e- >setRequestData($rd_new_with_key_value_pairs_for_replacements_in_tpl);$e->setOutputType($this->container->getOutputType()); $e->setActionName('Auth.ForgotPass'); $e->setModuleName('Mailer'); $html = $e->execute(); $html = $e->getResponse()->getContent(); // print_r_($html); if i try to write (i write this in a View): $e = new AgaviController(); $e->initialize($this->context); $e2 = $e->createExecutionContainer('Mailer', 'Auth.ForgotPass', $rd, $this->container->getOutputType()); i get error: *Catchable fatal error*: Argument 1 passed to AgaviExecutionContainer::setRequestData() must be an instance of AgaviRequestDataHolder, null given, called in/usr/local/share/php/agavi/controller/AgaviController.class.php on line119 and defined in*/usr/local/share/php/agavi/controller/ AgaviExecutionContainer.class.php*on line *665 *As u can i see i place in func call createExecutionContainer(.., .. , $rd, ..) $rd is instance of AgaviRequestDataHolder, but why error is shouting what $RD is NULL? I dont understad where i make mistake, a little egz of usage of createExecutionContainer call would be very nice.. Thanx _______________________________________________ users mailing list [email protected] http://lists.agavi.org/mailman/listinfo/users
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ users mailing list [email protected] http://lists.agavi.org/mailman/listinfo/users
