如何解決以下錯誤:不能重新聲明Cpages :: edit_galleries_picture()
Fatal error: Cannot redeclare Cpages::edit_galleries_picture() in C:\Program Files (x86)\EasyPHP-DevServer-14.1VC9\data\localweb\masterlinkci2\application\admin\controllers\Cpages.php on line 476
A PHP Error was encountered
嚴重性:Compile Error
消息:Cannot redeclare Cpages::edit_galleries_picture()
文件名:controllers/Cpages.php
行號:476
回溯:
的網址:http://localhost/masterlinkci2/admin/index.php/cpages/edit_galleries_picture/21
行476:public function edit_galleries_picture() {
從評論
public function edit_galleries_picture() {
$gallery_id = $this->uri->segment(3);
$data['pictures'] = $this->Mpages->call_gallery_pictures($gallery_id);
$this->load->view('editgalleries', $data);
}
發佈您的代碼.... – yogesh84
行476: 公共職能edit_galleries_picture(){ \t \t \t \t $ gallery_id = $這個 - > URI->段(3); \t \t \t \t $ data ['pictures'] = $ this-> Mpages-> call_gallery_pictures($ gallery_id); \t \t \t \t $ this-> load-> view('editgalleries',$ data); \t \t \t} – David
你的錯誤表明你已經聲明瞭公共函數edit_galleries_picture()兩次,這在php中是不可能的。請檢查,如果沒有找到,然後發佈您的控制器的完整代碼.. – yogesh84