Warning: Smartyerror: unabletoreadresource when using the smarty Template

Source: Internet
Author: User
Please help me to use the smarty template by checking Warning: Smartyerror: unabletoreadresource: This post was last edited by tiancai784071179 from 2015-05-2115:08:47: I checked it with $ tpl-& gt; template_dir, the template directory is correct. why do you want to help use the smarty template? Warning: Smarty error: unable to read resource:

This post was last edited by tiancai784071179 at 15:08:47

Template directory: I used $ tpl-> template_dir to check the template directory. Why can't the directory be displayed? please help me
Error message: Warning: Smarty error: unable to read resource: "admin" in D: \ AppServ \ www \ moban \ libs \ Smarty. class. php on line 1095
The following are the initialized programs.

Define (ROOT, "C:/AppServ/www/xsphp /");
Include ROOT. "libs/Smarty. class. php ";

$ Tpl = new Smarty;
$ Tpl-> template_dir = ROOT. "tpl /";
$ Tpl-> compile_dir = ROOT. "com ";
$ Tpl-> left_delimiter = "<{";
$ Tpl-> right_delimiter = "}> ";
Main program: Require "init. inc. php ";

$ Title = "this is a title ";

$ Content = "this is body content ";

$ Tpl-> assign ("title", $ title );
$ Tpl-> assign ("content", $ content );

$ Tpl-> display ("default/test. tpl ");


------ Solution ----------------------
I didn't see your display admin code? Is the code fully pasted?
------ Solution ----------------------
$ Tpl-> display ("default/test. tpl ");


The default/test. tpl file is not created.
------ Solution ----------------------
Have you specified that your tpl template file is under/moban/tpl?
------ Solution ----------------------
$ Tpl-> display ("admin"); this error
------ Solution ----------------------
Then
$ Tpl-> display ("admin. tpl ");

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.