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 ");