PHP beginners humbly ask

Source: Internet
Author: User
I am a beginner in PHP!
Now I want to make a simple website.
I don't want to use any frameworks (such as zend and yii)
Now the first question is: how can a parent page be loaded into a subpage?
The second question is: how can I implement MVC structure development? Or should the page and PHP code be basically separated to minimize coupling?


Reply to discussion (solution)

I am a beginner in PHP!
Now I want to make a simple website.
I don't want to use any frameworks (such as zend and yii)
Now the first question is: how can a parent page be loaded into a subpage?
The second question is: how can I implement MVC structure development? Or should the page and PHP code be basically separated to minimize coupling?

First problem: use iframe
Second question: the thinkphp framework is generally used.

1. import files using require and include
2. uniform Portal file, introduction of (require) php logic processing page (C), introduction of table model (M) in layer C, and finally introduction of View Page (V ), the V layer is only used to display the variables obtained by The C layer.

1. include in.
2. just use the template engine technology. you can use smarty.

The first question has been answered upstairs.
Second, if you don't want to use any framework, you can write php classes by yourself, such as database connection, registration, and Operation classes. writing classes by yourself can greatly improve your level.

I don't want to use any framework. can I? 1 ????. Which? Is it yourself? I? Framework.

No framework, so use smarty.

Your reply is very helpful. thank you!

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.