PHP code example of mikespub / epub-loader

1. Go to this page and download the library: Download mikespub/epub-loader library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mikespub / epub-loader example snippets


use Marsender\EPubLoader\RequestHandler;

// get the global config for epub-loader from somewhere
// get the current action, dbNum and urlParams if any

// you can define extra actions for your app - see example.php
$handler = new RequestHandler($gConfig, ExtraActions::class, $cacheDir);
$result = $handler->request($action, $dbNum, $urlParams);

// handle the result yourself or let epub-loader generate the output
$result['endpoint'] = 'index.php/loader';
$result['app_name'] = 'My EPub Loader';
echo $handler->output($result, $templateDir, $template);

class ExtraActions extends ActionHandler
{
    // ...

    public function more()
    {
        // do some more...
        return [
            'result' => 'This is more...',
            'extra' => 'easy',
        ];
    }
}