Jump to:

23372 Posts in 18172 Topics by 2865 members

General Questions

SilverStripe Forums » General Questions » Module detection

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: 1027 Views
  • r0nn1ef
    Avatar
    Community Member
    6 Posts

    Module detection Link to this post

    I've worked with SilverStripe on several non-production sites just trying to learn the system. I've created a few modules from scratch and incorporated those within the site with no problem. One thing I have run into several times is needing a way to detect if a particular module is installed.

    Is there a "SilverStripe way" of doing this? Something along the lines of Controller::moduleExists('module_name')? It seems like this should be a fairly common need from SS developers so I'm hoping someone has a simple method to do module detection.

  • swaiba
    Avatar
    Forum Moderator
    1785 Posts

    Re: Module detection Link to this post

    how about...

    if (ClassInfo::exists('classdefinedinmodule')) {
    //module exists, do stuff...
    }

    1027 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.