Jump to:

23379 Posts in 18298 Topics by 2867 members

General Questions

SilverStripe Forums » General Questions » Adding an extra PHP class

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

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

Page: 1
Go to End
Author Topic: 281 Views
  • theGermaniac
    Avatar
    Community Member
    82 Posts

    Adding an extra PHP class Link to this post

    Hej!

    I want to implement this third party class: http://mobiledetect.net/. 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

  • martimiz
    Avatar
    Forum Moderator
    1068 Posts

    Re: Adding an extra PHP class Link to this post

    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

  • theGermaniac
    Avatar
    Community Member
    82 Posts

    Re: Adding an extra PHP class Link to this post

    Yep, good idea: https://github.com/knsqnt/SilverStripe_DeviceDetection

    Thanks for your help.

    Best, Mario

    281 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.