1

I am new to use Visual Code for Joomla development. Watched few videos and referred https://docs.joomla.org/Visual_Studio_Code to setup the IDE.

I opened couple of PHP files and noticed few errors. One of the most common error is 'Undefined Type...'

Example

Undefined type 'JViewLegacy'.intelephense(1009)

Why it is showing the class as Undefined? Are there any configurations I am missing in VS?

3

I managed to resolve this by creating a stubs.php and place it inside the Joomla root folder.

Steps to create stubs.php

  1. Downloaded the Joomla build from github
  2. Extracted in my local folder
  3. Open a command prompt and navigate to joomla folder
  4. Run 'php build/stubGenerator.php'

This will create a file stubs.php. I manually copied this file to my working joomla folder.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.