Vheissu / Ci-Smarty

Smarty templating engine integration for Codeigniter 3.0+ with inbuilt theming and asset management.
http://ilikekillnerds.com
179 stars 43 forks source link

PHP Error #15

Closed andrew13 closed 12 years ago

andrew13 commented 12 years ago

I installed the plugin per the instructions and was getting the following error when going to the smartytest page.

A PHP Error was encountered

Severity: Notice

Message: Undefined variable: module_template

Filename: libraries/MY_Parser.php

Line Number: 91

If the module doesn't exist then the variable "$module_template" never gets created. I added an empty string before the if statement:

$module_template = '';
        // If we have a module
        if ( ! empty($this->_module) )

It could also be added in the else clause or change the logic of the if file exists logic. by doing something like.

        // Does this module view actually exist?
        if ( isset($module_template) && file_exists($module_template))
        {
            $template = $module_template;
        }

I ended up going with the latter.

andrew13 commented 12 years ago

Fixed in https://github.com/Vheissu/Ci-Smarty/commit/8b0dcfc1946907b032827d6339fe299792ff2775

andrew13 commented 12 years ago

Thanks for a great plugin