В чем ошибка или где ее искать?
Юлия Квитчастая1 ответов
public function delete($slug=NULL){
$this->data['news']=$this->news_model->getNews($slug);
if (empty($this->data['news'])){
show_404();
/*echo "Новость нельзя удалить!";*/
}
$this->data['title']="удалить новость";
$this->data['result']="Ошибка удаления ".$this->data['news']['title'];
if ($this->news_model->deleteNews($slug)){
$this->data['result']=$this->data['slug']['title']." успешно удалена!";
$this->load->view('templates/header',$this->data);
$this->load->view('news/delete',$this->data);
$this->load->view('templates/footer');
}
}
Выдает ошибку:
A PHP Error was encountered
Severity: Notice
Message: Undefined index: slug
Filename: controllers/News.php
Line Number: 99
Backtrace:
File: C:\xampp\htdocs\sneki_2020\application\controllers\News.php
Line: 99
Function: _error_handler
File: C:\xampp\htdocs\sneki_2020\index.php
Line: 315
Function: require_once
ошибка со slug только при удалении новости