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

`core/MY_Output.php` error when upgraded smarty to 3.1.30 #56

Closed mytharcher closed 7 years ago

mytharcher commented 7 years ago

I am using composer to autoload smarty library.

In smarty 3.1.30 the debug method has been changed into instance method rather than static (https://github.com/smarty-php/smarty/commit/6087ac5de0f7b5e6948ddb1e6d1ac0b1acb9948a#diff-3677dac38f0fef0ba3a6d370fe50ced6L192).

So in core/MY_Output.php the code should be changed like this with new instance:

            $CI =& get_instance();
            $smarty_debug = new Smarty_Internal_Debug();
            $smarty_debug->display_debug($CI->smarty, TRUE);
GeeMies commented 7 years ago

Actually the right way to fix the output for Smarty debug templates is

$CI =& get_instance();
$CI->smarty->_debug->display_debug($CI->smarty, TRUE);

If you create new Internal_Debug object here, its template_data will be empty and will not work so it's better to use the same Internal_Debug object that Smarty has initialized from beginning.

Vheissu commented 7 years ago

Cheers guys. I've just pushed an update.