-
Notifications
You must be signed in to change notification settings - Fork 715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with custom function "URL" #131
Comments
On all tags Smarty does check if a class Smarty_Internal_Compile_{tag} does exist. If not it looks for a plugin in the plugin folder. This is how all Smarty 3.1 versions work. Nothing has changed there. Your example does work at my place. Do you have other autoloader in your application? |
Thanks for your reply. |
Calling the autoloader for "Smarty_Internal_Compile_URL" is correct because the compiler does call the class_exists() method for it. That can't be the problem. It must be something else. Do you get compiled templates? Check the PHP error_log if something is reported there. |
As there is no further reply this issue gets closed. |
I think the compiler shall not check if class Smarty_Internal_Compile_URL exists if url is registered as plugin. Suddenly my URL plugin is not working anymore. Please reopen this issue. |
The compiler always checks if an internal compile class does exists. if this is not the cases it checks registered plugins. Note that plugin tag names are case sensitive. If you use {URL} it must registered as 'URL'. It does work at my place. |
I am using $_smarty->registerPlugin(Smarty::PLUGIN_FUNCTION, 'url', 'smarty_function_url'); I will be back with a backtrace if the problem is still persistent. |
You say: "The compiler always checks if an internal compile class does exists. if this is not the cases it checks registered plugins." / It should not be the other way around: "The compiler always checks checks registered plugins, if this is not the cases, checks if an internal compile class does exists?". Because if I do not have the class, Smarty will throw exception and become unusable. |
Not sure if it could be related to #199 |
This seems fixed. |
Since 3.1.28 the smarty autoloader tries to load the class Smarty_Internal_Compile_URL.
This will not work because URL is a custom function.
In 3.1.27 it is all ok.
My custom function (plugins/function.URL.php):
Template example: {URL path=$i1}
The text was updated successfully, but these errors were encountered: