PHP framework Laravel or CodeIgniter?

Source: Internet
Author: User
Keywords Php systemsarchitect codeigniter performance frameworks
Tags codeigniter
I have a project recently, the project is not very large, the need for a certain period of expansion, the key to consider is the speed of performance and development. My personal php base is OK, only contact smarty, a little familiar with MVC, did not really learn an MVC framework, can be said to be a novice, please for my present situation, give me some suggestions or your use of CodeIgniter and laravel experience, thank you! (Image quote for PHP framework performance Comparison / http Systemsarchitect.net/pe rformance-benchmark-of-popular-php-frameworks/

Reply content:

Recommend laravel!
Shun Update 2015 Most popular PHP framework reports:
More report information: More report information: / http LARAVELBASE.COM/POSTS/3 2
These two frameworks are not the same level.
CI is closer to the native PHP, the original PHP code based on the encapsulation of many classes, because it is simple structure, so easy to expand. From another point of view, there is no architecture, the most primitive three-tier architecture.
Laravel is simply an innovation, a large number of absorption of java,ror and other framework of the essence, in terms of architecture, has basically done the existing PHP framework of the best, extensibility, scalability is a great mess, very suitable for team combat.

For beginners, Laravel does not look much like PHP originally written, so-called elegance, is that you can know the meaning of the code, without reading the comments, the code is very thin reusability is very high; Laravel developers are the top players in the PHP circle, accustomed to using new technologies and architectures, Even so, laravel is not difficult to get started, once you have mastered its general point, you will gradually find it in every aspect of the overall transcendence of CI, and very high practicality.

The kernel extension of laravel is also very convenient (so powerful framework you have nothing to do to expand the kernel: D), but it is a small number of core classes of high coupling, you need to spend some time reading the source code and API. If it's a custom class, it's no problem at all, it's convenient.

P.S Welcome to visit the station I wrote with Laravel 5: larabase-php Craftsman's House

Say a digression: Laravel circle inside there is a wonderful, called Jeffery Way, he used to / http tutsplus.com When the editor, is specialized in teaching CI, and later became Laravel's death loyalty, now full-time teaching Laravel video courses, his website http://www. laracast.com This is probably the most powerful tutorial on the planet on programming, and those who say laravel data are less likely to look at it.

What the? English not? I think in order to laravel you can learn a language, it is that value. Small Project CI is also very recommended (of course, it depends on how small ...) )。

The biggest advantage of CI is that it is easy to get started and more friendly to beginners. How easy is it? Let's just say, I used to learn to write without PHP at all, Tiger, with CI developed a personal podcast website with full backstage.

Because it is an old project, CI's Chinese literature and cases are very rich. The documentation for CI itself is also very informative and easy to read. In 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, fully using the new features of PHP 5.3, unlike many old-style frameworks that have a lot of historical baggage.
The official documentation is extensive and scientifically categorized, with a little bit of PHP Foundation to get you started quickly and to write out the available sample programs
The core features are heavily used composer third-party libraries, which many people see as one of the ills of laravel, but I think this is the embodiment of its elegant design philosophy. Called The industry has specialized, professional people do professional things,Mature third-party class libraries are often the result of long iterations of professional teams, such as Laravel's large selection of symfony components, log library monolog, and time-base carbon are the most stable and popular libraries in the category.
I believe that after a short attempt, you will soon fall in love with Laravel and will love the convenience of composer.

The PHP FRAMEWORK for WEB artisans you, worth owning.
-------
Agree with @ Sheidi, the performance of the framework is not unimportant, but not important to the point of priority, in my very limited years of web development experience, I feel that 90% of the performance bottleneck is at the database level, the PHP level even if there is a real performance bottleneck, It is also painless and efficient to add PHP processing nodes linearly or open source projects using HHVM.

I think Web development is agile in most cases, so choosing a framework is roughly what you can consider:
1. Rapid development: The basic components are complete and not cumbersome, the framework of the design philosophy can help people quickly write elegant and efficient code (relatively)
2. Concise document rich and community active: The document is not much good, careful planning The document content is organized and Concise in-place typesetting can reduce the framework of the learning cost, more than the simple perfection piling content gaoming a lot. Active communities ensure that problems are quickly answered with a large number of tool modules
3. Clear logic: The framework's code logic is clear, the directory structure of the code is clear, collaborative development and code reuse is easy
4. Scalable and painless version updates: Core code Low-coupling , easy to expand, frame design predictability, version upgrade without merit Sword
5. Easy to test: Generally meet 4, the test will not be a big problem, codeception,phpunit this kind of third-party testing tools
6. Performance: Most Web applications do not need to consider the performance issues at the framework level, and there are a number of smooth solutions when you really need to think about framework performance issues
7. No major bug Bugs: This is of course the most important, but generally mature open source framework does not have this problem, put the last thinkphp it, this simple and easy to use, but the shortcomings are very obvious, in the update 26 letters ran out of the first to declare the PHP framework performance problem is really not important, performance problems are mainly the database that block.

Moreover, the PHP machine can be linearly extended, such as concurrent performance is not enough to support the current load, can be added to the machine solution. And you don't have to modify any code.

It is not a problem to theoretically scale linearly.

Besides the framework, the CI framework is a fairly concise framework, with all of it, such as input filters, URL routing, helper, and so on.

It's relatively easy to get started, but the components are framed, and it's really old. Many thoughts cannot keep up with the times.

Laravel relatively new, look at its route, write well, than CI route processing to be convenient and simple. A lot of new ideas in this frame

have been manifested. and Laravel's market usage is the highest, I believe most people choose it for a reason.

If you have not previously used the framework experience, it is recommended to use Laravel.

Second, the use of what framework is not important, it is important that you understand the framework and the ability to transform the framework.

So be sure to understand the framework of the source code, such as the database access layer, the principle of URL routing ...

Last picture (market share of different frames)

Probably read the code for both of them.
CI design is old-fashioned and has a history burden.
Laravel because it was later, it was more advanced in design.
I was inclined to laravel.

Compare the main technical requirements in your project to the respective documentation to see how much support you have.
And then spend a day using the two frameworks to write a user login register what's the contrast to try

As for the Chinese document what does not exist do not rely too much, dry this line will have to eat the Enlightenment of English documents only used CI and yii, on the level described by the up master, CI will be more suitable for you, in the short-term to develop products
Of course, the disadvantage of CI is that the object-oriented understanding is more inclined to the simple encapsulation, basically I still feel that I am doing the process-oriented work (level problem, you can also design a lot of classes to use flexibly, but after all, the frame light weight, To complete the complex design also need to have a high level of users) I have used Yii2 and laravel, simply say a bit. If you don't have a good front end, yii widgets are a good thing. Front-end pressure-free and beautiful. The code structure is also clear and the IDE hints better.
Laravle I think ideas are very advanced, including code organization and PHP features. But have to say facades these concepts, a little over-designed. But I think, the front-end classmate is very good, the document with Laravelcodeigniter is quite rich, Laravel 4 of the information is not much. CodeIgniter quite lightweight, download down can be used, Laravel 4 need to download and install a variety of third-party dependent library, in the domestic download speed is slow. CodeIgniter compatible PHP 5.2,laravel 4 requires PHP 5.3.7 or more.

The URL in CodeIgniter is routed to a controller by default, Laravel 4 allows for free customization with Router, and can even be used to handle some logically relatively independent requests, such as Captcha picture generation, without having to define a controller class. CodeIgniter database operations are generally in the form of Query Builder, or chain operation, Laravel 4 supports Query builder and eloquent ORM (very useful, can be split up and placed in other projects). Laravel 4 comes with artisan, and a very useful plug-in way/generators, able to automatically generate code, complete database migration, and so on, CodeIgniter no such tools. Laravel 4 comes with phpunit support, which makes it easy to write unit tests.

Finally, a tutorial on Laravel 4 is recommended: Code Bright:code Bright , the writing is more easy to understand. CodeIgniter intuitive, lightweight, easy to learn and easy to use. If you want to write your own PHP framework, out of the estimate is similar to CodeIgniter. You can use it to write small things, and then expand slowly. CodeIgniter will not hinder your planning and development, but will only standardize your program architecture. Of course, his shortcomings also lie in this: relatively humble, a lot of rude language also have to slowly get their own. But isn't that the advantage of PHP? If you really need an advanced cool frame, or rails is the right way, it's not a problem to dump all of PHP's frames on several streets.
  • 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.