Skip to content
This repository has been archived by the owner on Sep 1, 2020. It is now read-only.

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

Open
ryanrigby17 opened this issue Mar 2, 2018 · 0 comments

Comments

@ryanrigby17
Copy link

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);
        }
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant