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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Adding an extra PHP class

Go to End

3 Posts   703 Views


Community Member, 107 Posts

13 August 2013 at 1:14am


I want to implement this third party class: What is the best way to do it?

Tried to implement it via SiteTreeExtension, but didn't get it running. Anyone the solution?

Thanks, Mario


Forum Moderator, 1391 Posts

13 August 2013 at 5:46am

I'd probably write a simple MobileDetect module for SilverStripe, using a SilverStripe wrapper class around the thirdparty Mobile_Detect class.

This wrapper would 'include' the thirdparty class, instantiate it and provide some methods to communicate with it to get the results you want.

Then you could work with it just like with any SilverStripe class, from whichever Extention or Controller you'd want


Community Member, 107 Posts

13 August 2013 at 9:05pm

Yep, good idea:

Thanks for your help.

Best, Mario