- 🇮🇳India mdmanouwer
if file is node nto module file use
$foo = new \StdClass();
Having trouble getting the basics working.
What I did:
- I have a module with underscores in its name and I put MyClass.php in sites/all/custom/modules/my_module/lib/Drupal/my_module/MyClass.php
- I used a namespace Drupal\my_module in that class file
- I use Drupal\my_module\MyClass in a page call back in my_module.module
- I am NOT declaring using core drupal 7 files[] autoloading in info file
What happens when trying to create an instance of MyClass:
Fatal error: Class 'Drupal\my_module\StdClass' not found in /path/to/drupal/sites/all/modules/custom/my_module/lib/Drupal/my_module/MyClass.php on line foo
So the class file path is definitely correct so xautoload is definitely kicking in but something is going wrong after that and I can't work out why it's complaining about StdClass and not MyClass.
Closed: works as designed
2.3
Documentation
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
if file is node nto module file use
$foo = new \StdClass();