getPluginData

The method $this->getPluginData($filename) retrieves data from a file associated with the plugin. It fetches the specified file from the plugin's data folder.

  • @param: (string) $filename. The name of the file to retrieve the data from.
  • @return: (mixed) Returns the data from the specified file.

Example Usage

<?php

namespace Plugins\Myplugin;

use \Typemill\Plugin;

class Myplugin extends Plugin
{
    ...

    public function myFunction()
    {
        $data = $this->getPluginData('example.txt');
    }
}