PHP Classes


Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Classes of Sergio Vilar  >  PHP Kindle Periodical  >  >  Download  
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: PHP Kindle Periodical
Generate Kindle ebook file in .mobi format
Author: By
Last change: Implemented namespace, files moved to the src folder
Date: 1 year ago
Size: 1,652 bytes


Class file image Download
Kindle Periodical

Php class that helps to build kindle periodicals

**Important:** You need to add [KindleGen]( to your path to run KindlePeriodical

## Usage

First you need to create an array with the content of the periodical:

	$content = array(
		// Array of sections
			'id' => '0',
			'name' => 'My first section',
			'content' => array(

				// Array of articles
					'title' => 'Title of my first article',
					'content' => 'content of my article' // HTML is allowed
			'id' => '1',
			'name' => 'My toher section',
			'content' => array(

				// Array of articles
					'title' => 'Title of my other article',
					'content' => 'content of my article'

With this, you can now generate your .mobi file with KindlePeriodical:

     $ebook = new \Kindle\Periodical(array(
        "outputFolder" => "out",
        // Optional arguments:
        "shell" => false, // KindlePeriodical will use exec instead of shell_exec
        "debug" => true


        'title' => 'My Kindle Periodical',
        'creator' => "sergiovilar",
        'publisher' => "sergiovilar",
        'subject' => 'Sample Periodical',
        'description' => 'Set of articles in one .mobi file'

    // Generates the file
    $content = $ebook->setContent($content);

    // Return the file name
    $file = $ebook->getFilename();

    // Download the file

    // Remove the file and directory