PHP framework Laravel or Codeigniter?

Source: Internet
Author: User
Tags php basics
I recently want to build a project. The project is not very large and requires some extension later. The key consideration is performance and development speed. My personal PHP basics are okay. I have only been familiar with Smarty and I am a little familiar with MVC. I have not really studied a MVC framework. I can say that I am a newbie. Please refer to my current situation, give me some suggestions or your usage of Codeigniter and Laravel. Thank you! (Image reference compares the performance of the PHP framework with systemsarchitect. netperforma. I recently want to build a project. The project is not very large and needs to be expanded later. The key consideration is performance and development speed. My personal PHP basics are okay. I have only been familiar with Smarty and I am a little familiar with MVC. I have not really studied a MVC framework. I can say that I am a newbie. Please refer to my current situation, give me some suggestions or your usage of Codeigniter and Laravel. Thank you! (Picture cited from the PHP framework performance comparison http://systemsarchitect.net/performance-benchmark-of-popular-php-frameworks/ )

Reply content: Laravel!
Update the 2015 most popular PHP Framework Report:
More report information: More reporting: http://laravelbase.com/posts/32
These two frameworks are not at the same level.
CI is close to the native PHP, and many classes are encapsulated on the basis of the original PHP code. It is easy to expand because of its simple architecture. From another perspective, there is no architecture, the most primitive three-tier architecture.
Laravel is an innovation, absorbing the essence of other frameworks such as Java and RoR. In terms of architecture, Laravel has basically achieved the best existing Php framework, scalability, and scalability, suitable for team operations.

For new users, Laravel does not look very similar to the original Php writing. The so-called elegance means that you can understand the meaning of the code without reading comments, and the code streamlining and reusability is very high; laravel developers are the top PHP experts. They are used to new technologies and architectures. Even so, Laravel is not difficult to get started. Once you master the general points of Laravel, you will gradually find that it surpasses CI in every aspect and is highly practical.

Laravel's kernel extension is actually very convenient (you have nothing to do with this powerful framework: D), but it has a high coupling between a few kernel classes, you need to spend some time reading the source code and API. If it is a custom class, it is no problem, it is too convenient.

P.S: Welcome to the LaraBase-PHP craftsman's house, which I wrote in Laravel 5.

Laravel's circle has an amazing name, Jeffery Way. He used to be in http://tutsplus.com. When edited, it was dedicated to teach CI, and later became Laravel's dead loyal, now dedicated to teach Laravel video courses, his website http://www.laracast.com It may be the most powerful tutorial on programming on this planet. For those who say that Laravel has little information, go and have a look.

What? No English? I think you can learn a language for Laravel. For small projects, ci is still worth recommending (of course we have to see how small it is ......).

The biggest advantage of ci is that it is easy to get started and friendly to new users. How easy is it? To put it this way, I used to learn and write without php at all. I used ci to develop a one-person podcast website with a complete background.

Because it is an old project, ci has rich Chinese documents and cases. Ci documentation is also very detailed and easy to read. For horizontal comparison, I think ci is easier to get started than express on nodejs. Sincerely recommend Laravel

Laravel is a new framework developed after PHP 5.3. It makes full use of new features after PHP 5.3. Unlike many old-fashioned frameworks, Laravel has a lot of historical burdens.
Official documents are detailed, rich, and categorized into science. With a little bit of PHP basics, you can quickly get started and write available sample programs.
The core function uses a large number of third-party Composer class libraries. Many people think this is one of Laravel's drawbacks, but I think this is exactly the embodiment of its elegant design philosophy. The so-called Specialized professionals are specialized in the industry,Mature third-party class libraries are often the results of professional teams after long iterations. For example, Laravel selects a large number of symfony components, the log library monolog, and the time library carbon are the most stable and popular libraries in this category.
I believe that after a short attempt, you will soon fall in love with Laravel and the convenience of Composer.

The php framework for web artisans you deserve.
-------
I agree with @ Xie di that the performance of the framework is not unimportant, but does not matter to the point where priority needs to be given. Under my limited years of WEB development experience, I think 90% of the performance bottlenecks are at the database level. Even if a real performance bottleneck occurs at the PHP level, linear addition of PHP processing nodes or the use of open-source projects such as HHVM is a painless and efficient method.

I think WEB development is agile in most cases. Therefore, you can choose the following frameworks:
1. Rapid Development: the basic components are complete and not cumbersome. The design philosophy of the framework can help people quickly write elegant and efficient code (relatively speaking)
2. Concise and rich documentation and active community: Well planned documents are not too many Content organization and Concise and accurate layout can greatly reduce the learning cost of the Framework, which is much better than simply asking for more information. Active Communities can ensure quick response to problems and have a large number of tool modules
3. Clear logic: the code logic of the Framework is clear, the directory structure of the Code is clear, and collaborative development and code reuse are easy.
4. scalable and painless version updates: Low coupling of core code Easy to scale, predictable framework design, and Version Upgrade
5. Easy to test: Generally, if it meets 4, testing will not be a big problem. There are many third-party testing tools such as Codeception and phpunit.
6. Performance: Most WEB applications do not need to consider performance issues at the framework level. when you really need to consider the framework performance issues, there are also many smooth solutions.
7. No major BUG Vulnerability: Of course, this is the most important thing, but generally the mature open-source framework won't have this problem. Let's talk about thinkphp in the end. This is easy to use, but its disadvantages are very obvious, once 26 letters are updated, the first statement is that the performance problem of the PHP framework is really not important. The performance problem is mainly about the database.

In addition, PHP machines can be linearly expanded. If the concurrency performance is insufficient to support the current load, you can add machines to solve the problem without modifying any code.

Theoretically, linear expansion is not a problem.

Let's talk about the next framework. The CI framework is a very concise framework, which has such advantages as input filter, url routing, and helper.

It is relatively easy to get started, but these components are all available in the framework. Besides, they are indeed old, and many ideas cannot keep up with the times.

Laravel is relatively new. It reads its routes and writes well. It is easier to process than ci routes. There are many new ideas in this framework.

And Laravel has the highest market usage. I believe most people choose it for a reason.

If you have no experience using the framework, we recommend that you use Laravel.

Second, it is not important to use any framework. What matters is your understanding of the framework and your ability to transform the framework.

Therefore, you must understand the source code of the framework, such as the database access layer and the principle of url routing...

Previous figure (market share of different frameworks)

I have read the code of both.
CI design is relatively old and has a historical burden
Laravel is a latecomer and is more advanced in design.
I prefer Laravel.

First, compare the main technical requirements of your project to their respective documents to see how well the support is.
Then, you can use these two frameworks to write a comparison between user logon and registration in one day.

As for the existence or absence of Chinese documents, we should not rely too much on them. When we do this, we need to understand the English documents and use only CI and Yii to speculate on the level described by the master, CI is suitable for you and can be used to develop products in the short term.
Of course, the disadvantage of CI is that the understanding of object-oriented is more inclined to simple encapsulation. Basically, I still feel that I am doing process-oriented work (level problems, you can also design many categories for flexible use by yourself, but after all, the framework is lightweight, and users need to have a high level to complete complicated design.) I have used Yii2 and Laravel, just to put it simply. If your front-end is not very good, Yii's widget is a good thing. The front end is beautiful without pressure. The code structure is clear, and the IDE prompts better.
Laravle I think is very advanced, including code organization and php features. But I have to say that Facades is a little overdesigned. However, I think that if the front-end students are very good, laravelCodeigniter's documentation is quite rich, and Laravel 4 does not have much information. Codeigniter is quite lightweight and can be used after downloading. Laravel 4 needs to use composer to download and install various third-party dependent libraries. The download speed in China is very slow. Codeigniter is compatible with PHP 5.2. Laravel 4 requires PHP 5.3.7 or above.

The URLs in Codeigniter are routed to a controller by default. Laravel 4 allows customization using the Router, and even uses an anonymous function to process logically independent requests, for example, a verification code image is generated without defining a controller class. Codeigniter generally uses query builder or chain operations. Laravel 4 supports query builder and Eloquent ORM (very easy to use, which can be split separately and put into other projects ). Laravel 4 comes with artisan and a very useful plug-in, way/generators, which can automatically generate code and complete database migration. Codeigniter does not have such tools. Laravel 4 comes with phpunit support, allowing you to easily write unit tests.

Finally, we recommend a Laravel 4 Tutorial: Code Bright. Is easy to understand. Codeigniter is intuitive, lightweight, easy to learn and use. If you want to write a PHP framework by yourself, it is estimated that it is similar to Codeigniter. You can use it to write small things and then expand slowly. Codeigniter will not impede your planning and development, but will regulate your program architecture. Of course, his shortcomings also lie in this: it is relatively simple, and many rough words have to be done by yourself. But isn't that the advantage of PHP? If you really need an advanced and cool framework, or use rails, it's not a problem to get rid of all the PHP frameworks.

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.