HTML_Progress::setDM

HTML_Progress

Prev |  | Next
HTML_Progress::setDM sets the new instance of HTML_Progress_DM object ## Synopsis require_once 'HTML/Progress.php'; void HTML_Progress::setDM( string $model) ## Description This method is used to set the new instance of HTML_Progress_DM object used to manage mathematical data model. $model is the name of a class (that must exists) which inherit from HTML_Progress_DM. ## Parameter string $model a classname that will replace the default HTML_Progress_DM object. ## Throws

Possible PEAR_Error values

Error level | Error code | Error message | Solution
error | HTML_PROGRESS_ERROR_INVALID_INPUT | invalid input, parameter #1 "$model" was expecting "class defined" | Defines the new class
error | HTML_PROGRESS_ERROR_INVALID_INPUT | invalid input, parameter #1 "$model" was expecting "HTML_Progress_DM extends" | Fixed the inheritance of the new class
## Note ( HTML_Progress >= 1.0 )
| This function can not be called statically.
## See HTML_Progress::getDM ## Example

    <?php
    require_once 'HTML/Progress.php';

    class Progress_Plus extends HTML_Progress_DM
    {
        var $_plus;

        function Progress_Plus()
        {
            $this->setMinimum(0);
            $this->setMaximum(60);
            $this->setIncrement(1);
            $this->setValue(0);
            $this->myNewFeature('a new feature');
        }

        function myNewFeature($plus)
        {
            $this->_plus = $plus;
        }
    }

    $bar = new HTML_Progress();
    $bar->setDM('Progress_Plus');
    $dm =& $bar->getDM();

    print_r($dm);
    ?>
Prev | Up | Next
HTML_Progress::getDM | Reference Guide | HTML_Progress::isStringPainted
Documentation generated on Sun, 12 Sep 2004 20:23:08 +0200 by phpDocumentor 1.3.0RC3