How to learn a new PHP framework

original
2012/08/02 11:17
Number of readings 767

Nowadays, PHP frameworks are emerging one after another. I'm not an expert in this field, and I can't even use one of them skillfully. So I don't recommend it, nor do I want to discuss what is a framework and what is not. What I want to discuss here is how to start using a new framework more quickly.

First of all, you must select a framework, such as ZendFramework, Cake, Symfony, atk, Yii, CodeIgniter, Solar, PRADO, etc. Which one? Some frameworks provide a very good "step by step" tutorial, while others are difficult to get started.

I like this article:《 The exercises required to learn a new programming language 》, but I am already familiar with PHP, so this method cannot be used in the learning framework. So I want to list some similar exercises to learn PHP framework.

If you don't know how to use frameworks, why not follow the exercises in this article?

1. Hello world

I will not explain the necessity of the exercises here. Build an application on a new framework and display "hello world" on the page. Of course, it will not be so simple.

2. Calculator

Write a simple calculator program to add, subtract, multiply and divide two operands, and output the results to the page. You need to set a separate action or method for each operation (each frame is called differently), and also use the form validation function in the frame (if the frame provides this function).

3. Guestbook

Let's go back to 1998 - establish a message book program, display a form on the page for users to fill in, submit it to the application, and then store it in the database or text file (depending on your own situation), and display the content of users' messages on the page. If the framework provides functions such as creating HTML forms, object models, or layers, use them.

4. Parse and paginate

Select an RSS feed or other XML source, parse its entries and display them. At the same time, a paging function is added so that users can browse five pages and add page numbers at the top or bottom of the page. If the framework provides such a function, use it.

After completing the above exercises, you should be able to clearly know how to use the framework and use it to complete more complex work, or continue to explore other functions of the framework. If you still can't use it or spend a lot of time to complete the above exercises, then I think this framework is not suitable for you, so you'd better find some other ones to use.

Remember, if you encounter difficulties in using the framework, remember to go to the community of the framework for help. A framework supported by this strong community will greatly help you in your future work, and it also shows that this framework is a good one. No one wants the framework developer to stop developing six months after using a framework, which is too annoying.

Expand to read the full text
Loading
Click to join the discussion 🔥 (4) Post and join the discussion 🔥
Reward
four comment
seven Collection
zero fabulous
 Back to top
Top