public function render($vars = array())
    {
        if (null === $this->templateFile && null === $this->template) {
            throw new InvalidArgumentException('You must set a template or a template file before rendering');
        }

        extract($vars);
        ob_start();
        ob_implicit_flush(0);

        try {
            if (null !== $this->templateFile) {
                require($this->templateFile);
            } else {
                eval('?>' . $this->template . '<?php ');
            }
        } catch (Exception $e) {
            // need to end output buffering before throwing the exception #7596
            ob_end_clean();
            throw $e;
        }

        return ob_get_clean();
    }
public function render($vars = array())
    {
        if (null === $this->templateFile && null === $this->template) {
            throw new InvalidArgumentException('You must set a template or a template file before rendering');
        }

        extract($vars);
        ob_start();
        ob_implicit_flush(0);

        try {
            if (null !== $this->templateFile) {
                require($this->templateFile);
            } else {
                eval('?>' . $this->template . '<?php ');
            }
        } catch (Exception $e) {
            // need to end output buffering before throwing the exception #7596
            ob_end_clean();
            throw $e;
        }

        return ob_get_clean();
    }
public function render ( $ vars = array ( ) ) { if ( null === $ this -> templateFile && null === $ this -> template ) { throw new InvalidArgumentException ( 'You must set a template or a template file before rendering' ) ; } extract ( $ vars ) ; ob_start ( ) ; ob_implicit_flush ( 0 ) ; try { if ( null !== $ this -> templateFile ) { require ( $ this -> templateFile ) ; } else { eval ( '?>' . $ this -> template . '<?php ' ) ; } } catch ( Exception $ e ) { // need to end output buffering before throwing the exception #7596 ob_end_clean ( ) ; throw $ e ; } return ob_get_clean ( ) ; }
Render the template using the variable provided as arguments.

<code>
$template = new PropelTemplate();
$template->setTemplate('This is <?php echo $name ?>');
echo $template->render(array('name' => 'Mike'));
// This is Mike
</code>

@param array $vars An associative array of arguments to be rendered

@return string The rendered template

@throws InvalidArgumentException
@throws Exception
Render the template using the variable provided as arguments .