Ian P. Christian schrieb:
> In my lib/model/User.php, I have a method that 'publishes' data to an
> external site (facebook in this case).
>
> It does it like this:
>
> private function publish_internal()
> {
> $this->last_publish = time();
>
> $fb = sfFacebook::getInstance();
> $params = array('user_id' => $this->facebook_id,
> 'profile' => $this,
> );
> sfContext::getInstance()->getRequest()->setAttribute('params',
> $params);
> $ret =
> sfContext::getInstance()->getController()->getPresentationFor('profile',
> 'update');
> $fb->api_client->profile_setFBML($ret, $this->facebook_id);
> if (sfConfig::get('sf_logging_enabled'))
> {
> sfContext::getInstance()->getLogger()->info('{profile data} '.$ret);
> }
> }
>
> This is fine, however this can obviously be called from my main app,
> calling this from 'backend' means the getPresentationFor fails.
>
> I can't think how best to get around this - I want to be able to
> generate this output from both applications, and calling between apps
> via HTTP just seems crazy to get this done.
>
> Any ideas?
>
If working with "application independent" stuff I always put it into a
plugin. This way I can use it within each application.
Regards,
Matthias
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---