TP里面insert() 和update() 都调用了D函数。可是为什么update的D函数没有生效?

WBOY
Release: 2016-06-06 20:30:31
Original
1333 people have browsed it

<code>    public function insert()
    {
        $m = D($this->table);
        if(!$vo = $m->create())
        {
            $this->error($m->getError());
        }
        else
        {
          dump($vo);

  public function update()
    {
        $Form = D($this->table);
        if ($vo = $Form->create())
        {
            dump($vo);
//这是Model里面的
protected $_auto = array(
  array('prof', 'con', 1, 'callback'),
);



update的时候auto得不到调用。而insert就没有问题。我也是晕了。为什么会这样??
</code>
Copy after login
Copy after login

回复内容:

<code>    public function insert()
    {
        $m = D($this->table);
        if(!$vo = $m->create())
        {
            $this->error($m->getError());
        }
        else
        {
          dump($vo);

  public function update()
    {
        $Form = D($this->table);
        if ($vo = $Form->create())
        {
            dump($vo);
//这是Model里面的
protected $_auto = array(
  array('prof', 'con', 1, 'callback'),
);



update的时候auto得不到调用。而insert就没有问题。我也是晕了。为什么会这样??
</code>
Copy after login
Copy after login

抱歉。我不该问这么弱智的问题。。查了下文档。没写填充时间。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template