I searched this forum, read the documentation (https://resources.phplist.com/develop/plugins) and inspected some existing plugins. However, it’s still not clear to me how I can use phplist functions within a plugin page.
I use phplist version 3.3.1.
I want to render a dropdown with all categories and then a list of all lists.
What I did:
Created MyPlugin.php and MyPlugin folder in a custom plugins folder.
Inside MyPlugin folder I have a page myindex.php.
Now I’m stuck. How can I get the data from the database in the page myindex.php?
In the documentation it says, that “PHPlist provides a variety of specialized functions for getting data from and storing data in the database, so that you may not need to access the database directly.” e.g. getListsAsArray()
But how do I call this function in myindex.php?
The file mysqli.inc also provides methods for accessing the database directly and I set $database_module in config.php. The documentation says, “You can consider the database to be connected and there’s no need to connect again.”
But again, how to I use those methods? Do I have to include specific files? Add functions to the MyPlugin.php and access them in the myindex.php? Or pass data to the page? How?
I hope someone can show me the right way…