Gazley Posted March 23, 2014 Share Posted March 23, 2014 HI there, I've just created a new module with autoload set true, in a new install of ProcessWire in a new version of Mamp using PHP 5.5.10. The problem I'm having is that when I reference wire('ModuleName'), I'm getting nothing back (it's null). If I say $modules->get('ModuleName'), I get a reference to the module. I get the same problem using the 'Helloworld' module supplied with ProcessWire. Any ideas what the issue might be? Is anyone using PHP 5.5.10 - maybe this is a problem? Thanks! Link to comment Share on other sites More sharing options...
ryan Posted April 5, 2014 Share Posted April 5, 2014 wire('ModuleName') is not a syntax that ProcessWire uses. You can just retrieve API variables from wire(), like pages, page, user, session, etc. To retrieve a module, you would use $modules->get('ModuleName'); It's true that some autoload modules might set their own API variables that can be accessed with wire(), but most don't. One example of an autoload module that does that is LanguageSupport.module, which sets a 'languages' API variable that can be accessed via wire('languages'). 1 Link to comment Share on other sites More sharing options...
Gazley Posted April 5, 2014 Author Share Posted April 5, 2014 Thanks for clarifying, Ryan! Link to comment Share on other sites More sharing options...
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