Questions about separation of HTML code and PHP-php Tutorial

Source: Internet
Author: User
Question about the separation of HTML code and PHP look at the http://123langzheng.blog.163.com/blog/static/1362078062011125111528576/

The following example illustrates their usage. assume that the IntegratedTemplate class and the IntegratedTemplateExtension class are in C: \ php4 \ pear \ HTML \ ITX. php and C: \ php4 \ pear \ HTML \ ITX. php. The code we wrote is stored in C: \ TestPHP \ PHP4 \ Welcome.htm and C: \ TestPHP \ HTML \ Welcome. php. Set C: \ TestPHP \ PHP4 to a virtual directory/testphp on the Web Server and grant the script execution permission. make sure that C: \ TestPHP \ HTML \ Welcome.htm cannot be accessed through a remote browser. Set include_path = ".; C: \ php4 \ pear" in php. ini"



I used Zend Studio 10.0 and php 5.4.

Assume that the IntegratedTemplate and IntegratedTemplateExtension classes are in C: \ php4 \ pear \ HTML \ ITX. php and C: \ php4 \ pear \ HTML \ ITX. php respectively.



What does that mean? Why do we need to assume that? Where are the IntegratedTemplate and IntegratedTemplateExtension classes?
What is the pear folder?

I have read the tutorial "PHP from entry to proficient in version 2". what about this?

The above description is already quite adequate, but I am too stupid to understand it?


Reply to discussion (solution)

1. pear is a class library written in php code. it is popular in PHP4.
Because php5 introduces a large number of new features, some classes that originally needed to be written in code are also finalized and built into the php system.
So now the php4-based tutorial is outdated.
2. Separation of html code and php code, collectively referred to as template technology
Compared with Smarty, the professional template engine IntegratedTemplate and IntegratedTemplateExtension are pediatrics.
Smarty is also written in php code and needs to be introduced during use
Smarty 4 has been deployed in Java, and there is a tendency to replace Jstl
3. of course, a huge system is not necessarily suitable for practical applications, so most open-source php projects have their own template engine.
4. it is better to write mixed-coding code at the beginning, which is conducive to the systematic learning of structured programming ideas.
After in-depth analysis, you will find that the template technology is superior, and then you have the ability to write your own template engine.

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.