Why should the typecho route table be stored in the database, and why should each url be written in this form?

Source: Internet
Author: User
After reading the source code of typecho, the structure is still quite compact. it seems that there is a heavy java object design idea, but there is a lot of doubt about the route table settings. The current statement basically fixed this structure. why not let users configure it? for example, the route table exists in a certain... after reading the source code of typecho, this structure is still quite compact and seems to have a heavy java object design idea.
However, there is a lot of doubt about the route table settings.
The current statement is basically to fix this structure. why not let users configure it? for example, you can save a route table in a configuration file or implement the automatic routing function. Is it to keep it simple?
Now, if I want to do some new development, it seems that only the plug-in method is implemented.
Let's not talk about this question.

My problem is, for example, the following route table
'Attachment' =>

array (size=6)  'url' => string '/attachment/[cid:digital]/' (length=26)  'widget' => string 'Widget_Archive' (length=14)  'action' => string 'render' (length=6)  'regx' => string '|^/attachment/([0-9]+)[/]?$|' (length=28)  'format' => string '/attachment/%s/' (length=15)  'params' =>     array (size=1)      0 => string 'cid' (length=3)

After reading the code, it seems that the url field is not used, so is it just to prompt that the link is in this mode? Similar to the annotation function
I have neglected some of the functions, but I have some trouble in understanding them.

Reply content:

After reading the source code of typecho, this structure is still quite compact and seems to have a heavy java object design idea.
However, there is a lot of doubt about the route table settings.
The current statement is basically to fix this structure. why not let users configure it? for example, you can save a route table in a configuration file or implement the automatic routing function. Is it to keep it simple?
Now, if I want to do some new development, it seems that only the plug-in method is implemented.
Let's not talk about this question.

My problem is, for example, the following route table
'Attachment' =>

array (size=6)  'url' => string '/attachment/[cid:digital]/' (length=26)  'widget' => string 'Widget_Archive' (length=14)  'action' => string 'render' (length=6)  'regx' => string '|^/attachment/([0-9]+)[/]?$|' (length=28)  'format' => string '/attachment/%s/' (length=15)  'params' =>     array (size=1)      0 => string 'cid' (length=3)

After reading the code, it seems that the url field is not used, so is it just to prompt that the link is in this mode? Similar to the annotation function
I have neglected some of the functions, but I have some trouble in understanding them.

Do you mean the whole task is only for attachment?
The whole is useful to URLs.

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.