Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
217 views
in Technique[技术] by (71.8m points)

php - 如何在Codeigniter中使用数据表(How to use datatable in Codeigniter)

I'm using datatable 4 with Codeigniter, but I'm having problems with the buttons of my table: when I click the button it says error 404 .

(我在Codeigniter中使用了数据表4,但是我的表按钮出现了问题:当我单击按钮时,它显示错误404 。)

I don't know why that error appears, because I have the function created and it's in the same controller.

(我不知道为什么会出现该错误,因为我创建了函数,并且该函数位于同一控制器中。)

This a line of my code:

(这是我的代码行:)

<a href="'.base_url().'computo_controller/darBaja/'.$numSer.'" role="button">
    <i class="fas fa-trash btn btn-light" title="Dar de baja"></i>
</a>

and this is my function :

(这是我的功能:)

function darBaja($numSer){
    $this->db->where('numSerie',$numSer);
    $data = array(
        'Status' => "0"
    );
    $this->db->update('equipo',$data);
    redirect('computo_controller');
}
  ask by Freyre Gonzalez translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I think you have missed the php tag in the html part.

(我认为您已经错过了html部分中的php标签。)

It should be like the below code.

(它应该像下面的代码。)

<a href="<?php echo base_url().'computo_controller/darBaja/'.$numSer; ?>" role="button">
    <i class="fas fa-trash btn btn-light" title="Dar de baja"></i>
</a>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...