Smarty call problems.

Source: Internet
Author: User
Tags blank page
A blank page is running, I don't know where I didn't reference it. All the folders are in the same directory. My project contains the following folders: Smartysmarty_cache. The files are created separately by me. templates_c... the webpage is blank and I don't know where the reference is correct.

All Folders are under the same directory.

My project contains the following folders:

/Smarty

/Smarty_cache this file is created separately

/Templates this file is created separately

/Templates_c this file is created separately

Three files:/index. php/smarty. inc. php/templates/index. cpl

The content in index. php is as follows:

1
 Assign ('kaishi', 'I don't know how to test it! '); 5 $ smarty-> display ('index. cpl'); 6 7?>

The code in smarty. inc. php is as follows:

01
 Config_dir = ". /Smarty/Config_File.class.php "; // directory variable setting class 05 $ smarty-> caching = false; // do not use cache 06 $ smarty-> template_dir = ". /templates "; // set the template directory 07 $ smarty-> complie_dir = ". /templates_c "; // set the template compilation directory 08 $ smarty-> cache_dir = ". /smarty_cache "; // cache folder 09 $ smarty-> left_delimiter =" {"; 10 $ smarty-> right_delimiter ="} "; 11?>

The code in/templates/index. cpl is as follows:

01020304{$kaishi}05060708

09hello,{$kaishi}10

1112

The page is blank after running

Reply content:

The webpage is blank and I don't know where the reference is correct.

All Folders are under the same directory.

My project contains the following folders:

/Smarty

/Smarty_cache this file is created separately

/Templates this file is created separately

/Templates_c this file is created separately

Three files:/index. php/smarty. inc. php/templates/index. cpl

The content in index. php is as follows:

1
 Assign ('kaishi', 'I don't know how to test it! '); 5 $ smarty-> display ('index. cpl'); 6 7?>

The code in smarty. inc. php is as follows:

01
 Config_dir = ". /Smarty/Config_File.class.php "; // directory variable setting class 05 $ smarty-> caching = false; // do not use cache 06 $ smarty-> template_dir = ". /templates "; // set the template directory 07 $ smarty-> complie_dir = ". /templates_c "; // set the template compilation directory 08 $ smarty-> cache_dir = ". /smarty_cache "; // cache folder 09 $ smarty-> left_delimiter =" {"; 10 $ smarty-> right_delimiter ="} "; 11?>

The code in/templates/index. cpl is as follows:

01020304{$kaishi}05060708

09hello,{$kaishi}10

1112

The page is blank after running

There is no problem with the code you write. You may ignore the issue.
1. If you are doing a test in linux, it may be that your php error is not reported.
2. It is a test in the window. According to your description, you can only determine that the template is not parsed (otherwise, at least 'hello, 'will appear ,').

Your template file should not be loaded.

Related Article

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.