PHP Framework: PHP's Pandora Magic Box _php Tutorial

Source: Internet
Author: User
Tags php framework knowledge base shared hosting zend framework

What is the PHP development framework?

There are so many reasons why PHP is the world's most popular scripting language-highly flexible and easy to use-but when it comes to writing PHP (or any language) code, people often get bogged down in tedious, repetitive, and tiresome physical activity. And that's where the PHP development framework is.

By providing a basic architecture for developing web programs, PHP Development framework puts PHP Web application development on the pipeline. In other words, the PHP development framework helps facilitate rapid software development (RAD), which saves you time, helps create more stable programs, and reduces the effort of developers to write code repeatedly. These frameworks also help beginners create stable programs by ensuring proper database operation and programming only in the presentation layer. The PHP development framework allows you to spend more time creating real web programs rather than writing repetitive code.

The idea behind the PHP development framework is called "model-View-Controller" (MVC). MVC is an architectural pattern that isolates business logic from the UI, allowing it to change without being affected by another accesses than either. (also can be said to be the separation of concerns) in MVC, the model is responsible for the data, the view is responsible for the performance, the controller is the program body or is responsible for the business logic. In essence, MVC splits the development process of a program so that you can modify each part independently, while others are unaffected, which makes it much quicker and easier to write PHP code.

Why use the PHP development framework?

Developers may use PHP development frameworks for a variety of reasons, but the first is to speed up the development process. Code reuse between similar projects can save developers a lot of time and effort. The PHP development Framework is built-in with prebuilt modules, eliminating lengthy and tedious programming tasks. This allows developers to live on the actual program, rather than rebuilding the base module for each project every time.

Stability is another important reason for developers to use the framework. While simplicity is the biggest capital of PHP, and the reason many people love this scripting language, it is also the "Pandora's Box" of PHP, especially for beginners, where PHP is so simple that they write low-quality code completely unconscious. Such PHP programs may still work for most of the time, but you may have left a huge security hole in your code that makes it vulnerable to attack. It's important to keep in mind that PHP is a very loose language, so it's a top priority to make sure that you don't leave any security holes in your code-even if your program looks fine.

Finally, the PHP development framework is extensible and has many frameworks to choose from. You can also create your own, but many developers decide to choose from popular, well-known development frameworks because they tend to have a huge support team and the relevant forums/communities to make it easier for you to interact with other developers who use the same framework. Note that you should check in advance whether your project needs to use a framework, and here is a simple list for reference: Can the use of the framework save you (and anyone else who will use it) time and effort? Is it possible to get the program to perform better? Can you improve stability? If you answered yes to any of the above questions, then using the PHP development framework might be the right choice for this project.

When do I use the PHP development framework?

This is a developer, whether a beginner or an experienced expert, who often asks questions, but does not have a straightforward answer. For many beginners, the framework provides good stability and simplicity, so they think that the framework should be used as long as it can be used. It can reduce the generation of low-quality code and speed up project progress.

On the other hand, many experienced PHP programmers see frameworks as tools designed by "junior" programmers who don't know how to write high-quality, clear code. It's debatable whether this is right or wrong, but the fact that the PHP development framework is really a tool to save time and improve programming efficiency.

Using the PHP development framework is a huge benefit when working close to deadlines, because it can dramatically speed up the programming process. So if you have time constraints, using PHP to develop the framework is extremely correct. Another example of what should be factored into the PHP development framework is when you're busy with a project with a lot of repetitive code, because it helps reduce duplication of effort.

What should I focus on in the PHP development framework?

People looking for PHP development frameworks will see a variety of options, and you can even create your own, although it is only recommended that PHP experts do this. When looking for the PHP development framework that best suits your needs, it's important to always think about who will use and/or completely modify it. If there are many people using this program, it is best to use a framework that most developers are familiar with. On the other hand, if you want a Web application that you use yourself, you'd better choose a PHP development framework that you feel most comfortable with-whether it's popular or not.

There are a number of factors to consider when looking for a PHP development framework: Ease of use, agile development/performance, popularity among other developers, strong features, and support/forums. I recommend you first try several different PHP development frameworks, to find out the most suitable for your needs, the various frameworks have a slight difference, with different strengths and weaknesses. Take the Zend Framework, the V3 version comes with a rich feature, plus an extensible support system, all because it exists long enough. As a control, cakephp is another young PHP development framework than the Zend Framework, and its support system is slightly smaller (although support for this framework is growing rapidly), but cakephp is more user-friendly and easy to use.

As you can see, each PHP development framework has its own bit, so it's a good idea to try something first and catch some errors to find out which framework best serves your needs. Another good way to choose a framework is to consult with your colleagues in the developer community and ask what they like. Those who have really used a framework will tell you whether it is easy to use, features, available support, areas of the community surrounding the framework, and they may tell you about its shortcomings.

The most common errors when using the PHP development framework

There are errors in any type of programming, but the PHP development framework can greatly limit the generation of these errors because it provides the correct code that is validated from the beginning of the development process. And it seems that repetitive code writing increases the probability of errors occurring, and the framework solves or at least reduces the problem.

That said, there are still issues to be aware of using PHP development frameworks. For example, unless you are a PHP expert, you should choose a popular framework that has rich support and a certain amount of active user base (some popular PHP development frameworks are listed below). There are many frameworks that have little or no support, and/or are created by people with limited knowledge of PHP. These frameworks can cause your program to not work properly and, worse, cause a catastrophic security problem on your site.

Another common mistake is to not ensure that the database and Web server are compatible with a specific framework. For example Seagull PHP Framewor recommends the following configuration:

    • php:php 4.3.0 is the minimum configuration, and later versions are also supported, PHP 5.1.1 and later versions are also available. Please avoid any 5.0.x series of things.
    • Mysql:mysql 4.0.x, 4.1.x and 5.0.x support, you can also use 3.23.x.
    • Apache:seagull works very well in the 1.3.x and 2.x series of Apache.

If you do not meet these requirements, you will not be able to get the best possible performance for the chosen framework. Even if you are a PHP expert, you should read its documentation before attempting the framework to ensure compatibility.

Similar to the above error, not following the recommended installation steps to install your PHP development framework will also bring you headaches. Still using seagull as an example--seagull has a detailed framework installation process on the wiki, with several key steps that are sometimes easily overlooked by careless or unsuspecting developers. The point is that when you put the frame together, you can save unnecessary time overhead in the next practical development.

What is the best PHP development framework to use now?

In recent years, PHP development frameworks have sprung up on the screen as PHP evolves as a scripting language that many developers choose. People are always arguing about which PHP development framework is best, but not every framework is created for everyone, which is a simple fact. Here are five of the best and most popular PHP development frameworks:

    • The Zend framework:the Zend Framework has a large number of followers in the development community, and it is dedicated to Web 2.0-style programs. Zend is called "the PHP Company" because its numerous followers are composed of an active user-developed extension support. Zend is a, or may not be, the most popular PHP development framework available today. It has robust features that support collaborative development, and it requires some extra knowledge of PHP.
    • Cakephp:cakephp is a good choice for beginners and professional PHP developers. It's built on the same principles as Ruby on rails, and it's focused on rapid development-making it a great development framework for RAD. Its fast-growing support system, simplicity, and scalability make cakephp one of the most popular PHP development frameworks available today.
    • Codelgniter:codelgniter is known for its ease of use, performance and speed. Unlike Symphony, this PHP development framework is ideal for shared hosting users if you want to have a small coverage framework. It provides a simple solution, as well as an extended knowledge base, supported by video tutorials, user guides, and wikis.
    • Symfony:symfony is intended for developers who are more professionally focused on developing enterprise-class programs-especially Askeet and Yahoo! Bookmarks. This open source PHP development Framework is rich in features and is more than enough to do this, and its main drawback is that it is slightly slower than the other frameworks.
    • Seagull:seagull is a good PHP development framework that can be used to develop Web, command-line and GUI programs. This is a simple development framework for both beginners and professional programmers. For starters, Seagull provides a library of sample programs that can be easily modified to meet your requirements, and for expert programmers, Seagull provides a set of setup options-including best practices, standard and modular code libraries-to quickly and easily build Web programs. Seagull has an active user community and rich support documentation.

Summarize

The PHP development Framework is a good way for developers of all levels of competency to reduce the need for repetitive coding, while speeding up the development process and ensuring that the correct code is written when the Web program is created. This not only accelerates the development of complex programs, but also reduces security vulnerabilities in your code to enhance PHP security.

While some expert PHP programmers feel that there is no need to develop web programs using the development framework, they still have great advantages in rapid software development, such as under tight deadlines. For beginners or medium-sized developers, the development framework can improve PHP learning efficiency while promoting the practice of writing high-quality code and reducing low-quality code, which often occurs because of PHP's own "loose" nature.

There are many PHP development frameworks available today, so developers are sure to find a framework that meets their needs in terms of features, support, speed, scalability, and so on. The top PHP development frameworks used by developers today are: the Zend framework,cakephp,symfony,codelgniter and Seagull.

http://www.bkjia.com/PHPjc/752335.html www.bkjia.com true http://www.bkjia.com/PHPjc/752335.html techarticle What is the PHP development framework? There are so many reasons why PHP is the world's most popular scripting language-highly flexible and easy to use-but write PHP (or any language) code ...

  • 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.