I muddled my way through this before. I'm not the best person to answer. But hope this helps.
For some people, getting stuck straight into a project is the best way to learn, and the aim is that in the following sections you will learn how to build an add-on, from scratch. Be prepared; this isn't a simple 'Hello world' type demo. This is actually a fairly full featured demo add-on which...
xenforo.com
Create an AddOn. Answer "No" to Does your add-on need a Setup file. Name it DIRECTORY/NAME. In my case, it's AHK/BrowseImages
I created a PHP file called "Browse.php" in that directory which lives at src/addons/AHK/BrowseImages
Code:
<?php
namespace AHK\BrowseImages;
class Browse
{
public static function getHtml()
{
$output=file_get_contents("file.txt");
return $output;
}
}
On the Page in the TEMPLATE Html, I added this:
Code:
<xf:callback class="\AHK\BrowseImages\Browse" method="getHtml"></xf:callback>
and it read the file and outputted it onto a XF page.
It was by trial/error based on posts here. So it may be wrong in ways.
arn