Why does thinkphp auto-fill fail?

Source: Internet
Author: User

Cause 1: The developer assigns parameters to the add () method through arrays.
In this way, the "auto-fill" of TP is taken over, and the fields in the auto-fill cannot be automatically assigned.

For example:
$ Data ['stopic '] =_ _ post ['stopic'];
$ Data ['scontent'] =_ _ post ['scontent'];
$ Result = $ obj-> Add ($ data );

In the following code, the ddatetime field cannot obtain the value of the function time:
Protected $ _ auto = array (
Array ('ddatetime', 'time', self: model_insert, 'function '),
);

Cause 2: The Module name in D ('module name') must be the same as the module name model. class. in PHP, it generally starts with an upper case and corresponds to a table name. Table names are all lowercase letters.
For example, the table name is think_article, D ('module name') is D ('Article'), and "module name model. Class. php" is articlemodel. Class. php.

Zhang Qing (mesh), Weibo: http://t.qq.com/zhangking
From mesh horizon: http://blog.why100000.com
Why 100,000 computer learning networks: http://www.why100000.com

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.