dwoo-project / dwoo

[UNMAINTAINED] php template engine
http://dwoo.org
GNU Lesser General Public License v3.0
167 stars 58 forks source link

PhpDoc for get() function in Dwoo\Core says you can pass a template as a string. You cannot. #79

Open ryanrigby17 opened 6 years ago

ryanrigby17 commented 6 years ago

The file: https://github.com/dwoo-project/dwoo/blob/master/lib/Dwoo/Core.php#L301

PhpDoc

     * @param mixed     $_tpl      template, can either be a ITemplate object (i.e. TemplateFile), a
     *                             valid path to a template, or a template as a string it is recommended to
     *                             provide a ITemplate as it will probably make things faster, especially if
     *                             you render a template multiple times

Code that handles the template parameter

        if ($_tpl instanceof ITemplate) {
            // valid, skip
        } elseif (is_string($_tpl)) {
            $_tpl = new TemplateFile($_tpl);
            $_tpl->setIncludePath($this->getTemplateDir());
        } else {
            throw new Exception('Dwoo->get\'s first argument must be a ITemplate (i.e. TemplateFile) or a valid path to a template file', E_USER_NOTICE);
        }