hi u can use method "getPresentationFor" in your one of the actions class as
$this->getController()->getPresentationFor($module_name, $method_name ); On Thu, Aug 27, 2009 at 4:41 AM, Jose R. Prieto <[email protected]>wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi, > > I need to call another action from the current action is running > symfony (formally, I need to instantiate other action, execute, and > get its result). > > The idea is to do something like this: > > class apirouterAction extends sfAction > { > public function execute($request) > { > // DEBUG: > $this->logMessage('JRPP: apirouterAction->execute()', > sfLogger::getPriorityName(sfLogger::DEBUG)); > $myAction = new name_of_the_other_actionAction($request); // we > instantiate another action that is in the current module, or in > another module > $myAction->execute(); > $output = $myAction->render(); > $this->renderText($output); > return sfView::NONE; > } > } > > > That is, execute, render and capture the output of another action > (that is in the current module, or in another), and render this output > and display it in the current action (the sfView:NONE is because the > response is a JSON) > > The option of a component isn't a solution for my problem, because > these actions may be executed in "normal" mode (the same action may > has different views, depending on how or from where you call it). > > The option of doing a forward(), is a partial solution; the router > that I want to construct, is defined by the specs in this way: > > "Once a transaction has been accepted it must be dispatched by the > router. The router must construct the relevant class and call the > method with the appropriate arguments which it reads from data. > Currently, the Ext.Direct specification expects this to be an array. > In the future, we plan to add support to be key/value pairs in an object." > > The option of use the current plugin of Ext.Direct, isn't a good > solution for me, because the current plugin uses other enviroment to > change the controller class of symfony in the Ext.Direct request. > > Have you got any ideas? > > Thanks a lot. > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.9 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iQEcBAEBAgAGBQJKlcEEAAoJEFlRSentq+j0K/YIAKKt2EoCx7qbnmVja+bSl52y > 0wNDLZUaHNl+A8VxktmTvkONIocizmZhx4QhjzeKFLHEFiW2OfiSm43yPx+LDP45 > q3AwLsji8T8+u1g77TcWBxFC/b7y5g40TCWYtmZPynl51Q4R56OpgnqkFEe2W+nC > FUBC/bpQUcTyF55kB5HHPf3nzJAwqXGA2FV8c4JvcBjbTj45Xqq9WDjH5pd2BuFn > WTud1LQxIhzCSjv3/SMiEfQnB0lHVSmsshnCZFWazK5VVv8994jkrueJq6qPVnO9 > C/NGdXsUNWdLufnOtZJ8/BO8lExIlWIAT0mVh3OR8Ud14m0Ff0t7+MLBylp7KFY= > =NkgW > -----END PGP SIGNATURE----- > > > > > -- Regards, Dheeraj --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" 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-users?hl=en -~----------~----~----~----~------~----~------~--~---
