I think laravel is very difficult to learn. The routing rules alone are quite tiring.
高洛峰
高洛峰 2017-05-16 16:55:01
0
7
1229

I’ve been learning the laravel framework recently, and I find it difficult to get started. Take route mapping as an example, you have to configure it yourself. It feels very troublesome. When writing a controller, you need to configure a route. It is not as simple as the automatic mapping of tp and yii. I feel that such a powerful framework shouldn't be so troublesome. Is it because I don't know how to configure a default routing mapping rule?

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(7)
phpcn_u1582

It’s not difficult. It’s the design ideas that are different.

刘奇

You actually like...?controller=xx&action=xxx style.

过去多啦不再A梦

Recommend a Laravel learning website to the questioner, explained by Chinese people themselves.
https://laravist.com/

滿天的星座

Although Laravel itself has relatively complete documentation and API, if you only look at the documentation and API, there may indeed be some obstacles for many unfamiliar web developers. It is recommended to refer to:
Laracasts, a detailed step-by-step teaching video;
laravel.io/forum, a laravel forum that covers many issues;
laravel 5 book, a laravel teaching book that can be read online.
Code Bright written by Dayle Rees can also be read, it will explain many reasons for Laravel's internal mechanism.

Laravel uses a more elegant way to grasp many details, so it calls itself "The PHP Framework For Web Artisans".

習慣沉默

The feature of automatically matching URLs with controllers is nothing to laugh at or deny. You can say that the reason why Laravel is not designed this way is because of blabalbal... and the like, but you can't say that this requirement is weird.

As for imagining that others prefer the "?controller=xx&action=xxx" style, it is completely based on nothing.

Suppose I have to use Laravel one day and I want to write less rules, I plan to do this.

First make two files, router.custom.php and router.auto.php

auto is used to store automatically generated routing rules, and custom is used to store routing rules written by yourself. After all, it is difficult for automatic generation to cover all special needs

Then write comments on the controller that needs to automatically generate routing rules

/**
 * @base_uri user
 */
class UserController extends Controller {
    /**
     * @method GET
     * @path profile
     */
    public function showProfile() {
    }
}

Then write a script, use the reflection class to parse all the controller classes in the controller directory, generate routing rules based on the comments you defined, and put them in the auto file

In short, this is the general idea.

I also think it is quite troublesome to write a route in Laravel when writing a controller.

过去多啦不再A梦

Laravel is not difficult to learn. If you learn symfony, you will know that laravel is not difficult. Moreover, there are many Chinese documents for laravel. Now there are many people using laravel in China, but I don’t know why I can’t search for laravel exchanges in qq. The group seems to have been blocked by Tencent (I found out after reading the comments that it was blocked by mistake).

滿天的星座

I once suffered from the pitfalls of the default configuration mentioned by the poster. For example, it is difficult to distinguish get and post for the same URL using RESTful...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template