Open markocrni opened 6 months ago
Well, the PHP docs state: "For functions and constants, PHP will fall back to global functions or constants if a namespaced function or constant does not exist." and the units indicatie this works perfectly. Somehow, it seems you have not loaded the 'functions.php' file, even though it is defined in composer.json autoload.files.
Thanks for your reply. Acutaly I don't use composer, because it's not an option for the project I'm working. I think it would be good if you post instructions on how to include Smarty without composer, because I believe there are more cases like mine. My code for autoregistring and loading Smarty
AutoLoader::register(function ($sClassName) {
if($sClassName === 'Smarty') {
include( FWK_DIR . 'lib_tp/Smarty/Smarty.php');
include( FWK_DIR . 'lib_tp/Smarty/functions.php');
return;
}
$aParts = explode('\\', $sClassName);
if((isset($aParts[0]) && $aParts[0] === 'Smarty')) {
include( FWK_DIR . 'lib_tp/' . str_replace('\\', '/', $sClassName) . '.php');
}
});
I'll do a little more research here...
can you explain why using composer is not an option?
The whole problem was that functions.php was not loaded. I still think it would be nice if you post instructions on how to include Smarty without composer.
But you cannot explain why using composer is not an option?
Smarty 5.0.0 rc2, php 8.2.13 In template : {$smarty.cookies.username} or {$smarty.request.page}
Throws error: 'Call to undefined function Smarty\Compile\smarty_strtolower_ascii()', in file '/Smarty/Compile/SpecialVariableCompiler.php', at line 45