I am very grateful for the question about the smarty is_cached () method.

Source: Internet
Author: User
For questions about the smarty is_cached () method, please help me. I am very grateful. fatal error: Uncaught --> Smarty: Smarty-> is_cached () undefined method <-- thrown in/usr/local/apache2/htdocs/www/smarty/libs/sysplugins/smarty_internal_undefined.php on line 46


Today, if (! Is_cached ("var.html", $ _ SERVER ["REQUEST_URI"]) {
Echo "today is beautiful day!
";
}
To test whether smarty is cached. the above error occurs. my smarty version is: smarty-3.1.29. isn't my smarty version missing this method? If this method is not used, what method is used instead? Please help me solve this problem. thank you very much ....


Reply to discussion (solution)

You can call print_r (get_class_methods ('smarty?

Besides, if (! Is_cached ("var.html", $ _ SERVER ["REQUEST_URI"]) {is it true?

Second floor, use
Echo'

';
Var_dump ($ smarty );
Echo'
';
The result is as follows,
Object (Smarty) #1 (65 ){
["Auto_literal"] =>
Bool (true)
["Error_unassigned"] =>
Bool (false)
["Use_include_path"] =>
Bool (false)
["Template_dir": "Smarty": private] =>
Array (1 ){
[0] =>
String (42) "/usr/local/apache2/htdocs/www/smarty/temp /"
}
["_ Joined_template_dir"] =>
String (42) "/usr/local/apache2/htdocs/www/smarty/temp /"
["_ Joined_config_dir"] =>
String (44) "/usr/local/apache2/htdocs/www/smarty/configs"
["Default_template_handler_func"] =>
NULL
["Default_config_handler_func"] =>
NULL
["Default_plugin_handler_func"] =>
NULL
["Compile_dir": "Smarty": private] =>
String (41) "/usr/local/apache2/htdocs/www/smarty/com /"
["Plugins_dir": "Smarty": private] =>
NULL
["Cache_dir": "Smarty": private] =>
String (43) "/usr/local/apache2/htdocs/www/smarty/cache /"
["Config_dir": "Smarty": private] =>
Array (1 ){
[0] =>
String (44) "/usr/local/apache2/htdocs/www/smarty/configs"
}
["Force_compile"] =>
Bool (false)
["Compile_check"] =>
Bool (true)
["Use_sub_dirs"] =>
Bool (false)
["Allow_ambiguous_resources"] =>
Bool (false)
["Merge_compiled_includes"] =>
Bool (false)
["Force_cache"] =>
Bool (false)
["Left_delimiter"] =>
String (2) "<{"
["Right_delimiter"] =>
String (2) "}>"
["Security_class"] =>
String (15) "Smarty_Security"
["Security_policy"] =>
NULL
["Php_handling"] =>
Int (0)
["Allow_php_templates"] =>
Bool (false)
["Debugging"] =>
Bool (false)
["Debugging_ctrl"] =>
String (4) "NONE"
["Smarty_debug_id"] =>
String (12) "SMARTY_DEBUG"
["Debug_tpl"] =>
NULL
["Error_reporting"] =>
NULL
["Config_overwrite"] =>
Bool (true)
["Config_booleanize"] =>
Bool (true)
["Config_read_hidden"] =>
Bool (false)
["Compile_locking"] =>
Bool (true)
["Cache_locking"] =>
Bool (false)
["Locking_timeout"] =>
Int (10)
["Default_resource_type"] =>
String (4) "file"
["Caching_type"] =>
String (4) "file"
["Default_config_type"] =>
String (4) "file"
["Resource_cache_mode"] =>
Int (1)
["Cache_modified_check"] =>
Bool (false)
["Registered_plugins"] =>
Array (0 ){
}
["Registered_objects"] =>
Array (0 ){
}
["Registered_classes"] =>
Array (0 ){
}
["Registered_filters"] =>
Array (0 ){
}
["Registered_resources"] =>
Array (0 ){
}
["Registered_cache_resources"] =>
Array (0 ){
}
["Autoload_filters"] =>
Array (0 ){
}
["Default_modifiers"] =>
Array (0 ){
}
["Escape_html"] =>
Bool (false)
["Start_time"] =>
Float (1461252359.6399)
["_ Current_file"] =>
NULL
["_ Parserdebug"] =>
Bool (false)
["_ ObjType"] =>
Int (1)
["_ Debug"] =>
NULL
["Cache_id"] =>
NULL
["Compile_id"] =>
NULL
["Caching"] =>
Int (1)
["Cache_lifetime"] =>
Int (3600)
["_ Cache"] =>
Array (6 ){
["Template_dir_new"] =>
Bool (true)
["Template_dir"] =>
Bool (false)
["Compile_dir"] =>
Bool (true)
["Config_dir_new"] =>
Bool (true)
["Config_dir"] =>
Bool (false)
["Cache_dir"] =>
Bool (true)
}
["Template_class"] =>
String (24) "Smarty_Internal_Template"
["Tpl_vars"] =>
Array (0 ){
}
["Parent"] =>
NULL
["Config_vars"] =>
Array (0 ){
}
["Ext"] =>
Object (Smarty_Internal_Extension_Handler) #2 (3 ){
["ObjType"] =>
Int (1)
["_ Property_info": "Smarty_Internal_Extension_Handler": private] =>
Array (7 ){
["AutoloadFilters"] =>
Int (0)
["Defamodimodifiers"] =>
Int (0)
["ConfigVars"] =>
Int (0)
["DebugTemplate"] =>
Int (0)
["RegisteredObject"] =>
Int (0)
["StreamVariable"] =>
Int (0)
["TemplateVars"] =>
Int (0)
}
["ResolvedProperties": "Smarty_Internal_Extension_Handler": private] =>
Array (0 ){
}
}
}
There is no is_cached () method. My question is, if there is no is_cached () method, which method can be used instead? Thank you very much...

Thank you for choosing the second floor ....

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.