Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

call function in different controller


Go to End


921 Views

Avatar
Lens-Art

Community Member, 4 Posts

31 March 2012 at 3:22am

I'm new to Silverstripe and I'm trying to extend an existing site, so sorry if the answer to this question is obvious.
I'm trying to connect via TCP to an external device if an event happens.
I've made a controller for this which is in a different php file than the one in which the event happens.

Can I call my TCP connect function with something like controller::socketConnectController()?
Or do I have to redirect to the controller via a director::addrules?

Maybe the way I implement this is not rigth at all but this, is what I though would be a good solution.
I hope it is clear what I want :)