SproutCMS

This is the code documentation for the SproutCMS project

class Preview

Somewhat complicated preview system which copies existing data into
temporary tables, then renders the preview via a front-end method call

Extending this class

<?php
/**
* New class description goes here
* 
* @author Your Name, 2026-09-16
**/
class NewClassName extends Preview {
    
    /**
    * Loads a preview by creating temporary tables in SQL, calling a
    * controller's _editSave method, and then calling a method it would
    * normally use to display its (non-temporary) data
    **/
    public function load (ManagedAdminController $ctlr, array $tables, int $record_id) {
        // Method code goes here
    }
    
    /**
    * Run a controller method using the preview data.
    * This injects the word 'PREVIEW' into the page title
    **/
    public function run (Controller $ctlr, string $method, array $args) {
        // Method code goes here
    }
    
}
?>