PHP AutoLoad: Solve PHP in the

Source: Internet
Author: User
Tags autoload

Recently, in the project found that the PHP __autoload method is invalid. Debugging for a long time, baffled, check the data to know that the original is Smarty reasons. The new Smarty changed the way the autoload.
The solution is to add a piece of code after the Smarty containing the class file, Spl_autoload_register ("__autoload");
As follows:
<?php
Define (' Root_path ', DirName (__file__));
Require_once Root_path. '/includes/smarty/smarty.class.php ';
Spl_autoload_register ("__autoload"); Add this piece of code
?>
This article links http://www.cxybl.com/html/wlbc/Php/20121013/32997.html

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.