arjen Posted July 4, 2013 Posted July 4, 2013 I've made a simple module called MarkupBox which is not installed in the CMS, but the files are in the module directory (/site/modules/). When I call the module from a template it returns the value. I suppose there is a way to check if a module is installed, but I can't find it in the code or in the forums. I'm looking for someting like: if ($modules->get("MarkupBox")->isInstalled()) { // Do something } Module: public function render() { $out = "Test"; return $out; } Template: $box = $modules->get("MarkupBox"); echo $box->render(); Thanks! 1
nik Posted July 4, 2013 Posted July 4, 2013 You're very close actually . This is how it works: if($modules->isInstalled("MarkupBox")) { // do something } 8
Soma Posted July 4, 2013 Posted July 4, 2013 Actually $modules->get("MarkupBox") will install the module if it's not 4
arjen Posted July 4, 2013 Author Posted July 4, 2013 Thanks soma for the info. I ran into some issues but realised the module installed itself. My new code: if ($modules->isInstalled("MarkupBox")) { echo $modules->get("MarkupBox")->render(); } 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now