Strict Standards: Non-static method STemplate::assign() should not be called statically

匿名 (未验证) 提交于 2019-12-03 00:59:01

问题:

i Upgrade my old xampp (1.7.3) localhost server to 1.8.0 . now, not work smarty template engine (2.6.6) in my all page and i see Strict Standards error. what's problem? how to fix this ?

NOTE : This Wroked Fine In Old Xampp(1.7.3).

Section of Error :

Strict Standards: Non-static method STemplate::assign() should not be called statically in C:\xampp\htdocs\tube\include\config.php on line 88  Strict Standards: Non-static method STemplate::create() should not be called statically in C:\xampp\htdocs\tube\libraries\mysmarty.class.php on line 42  Strict Standards: Non-static method STemplate::setCompileDir() should not be called statically in C:\xampp\htdocs\tube\include\config.php on line 181  Strict Standards: Non-static method STemplate::setTplDir() should not be called statically in C:\xampp\htdocs\tube\include\config.php on line 182 

My Config Line Error :

STemplate::assign($field, $config[$field]); // line 88 STemplate::setCompileDir($config['basedir']."/temporary"); // line 181 STemplate::setTplDir($config['basedir']."/themes"); // line 182 

my.Smarty.class.php (error line 2)

function assign($var, $value) {         global $Smarty;         if (!isset($Smarty)) {             STemplate::create(); // <---- line 42         }         $Smarty->assign($var, $value);     } 

Thanks For Any Help :)

回答1:

It's because you're using a modern version of PHP with strict standards. You may be able to make the code work by making the declaration:

public static function assign($var, $value) 

However judging by the other errors you'll run into many problems. You can try disabling strict standards but it'd be best to upgrade to a modern version of Smarty.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!