Sourcerer v10.0.4 Ready-to-use PHP Variables &...

Search
Other Bug Reports questions
Forum

Sourcerer v10.0.4 Ready-to-use PHP Variables & Objects does not work in functions

Greg Taylor's Avatar Greg Taylor
Sourcerer v10.0.4 (free version)
Joomla 5.0.1
PHP 8.2

The predefined Joomla $db and $database objects work well in the main code of a PHP script but not inside a function. Reference:
docs4.regularlabs.com/sourcerer/the-basics/using-php-code
Ready-to-use PHP Variables & Objects
Peter van Westen's Avatar Peter van Westen ADMIN
Correct. That is how PHP works. A function is self-contained, and cannot access variables outside it.
Please post a rating at the Joomla! Extensions Directory
You can only post on this forum if you log in