• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tutorial error...?? (RESOLVED)

#20
[eluser]Peter Englmaier[/eluser]
... und hier das ganze auf deutsch:

Beim Durcharbeiten des Tutorials kam ich natürlich auch auf den 404-Fehler bei der Nachrichten-Ansicht.

Das Problem lag an den Variablen-Definitionen mit $news_item und $news. Hier im Detail, was geändert werden muss:

In ".../views/news/view.php": ändere $news_item in $news (2 x)

In ".../views/news/index.php: ändere $news_item in $news (4 x)

In ".../controller/news.php":
ändere den ALTEN Code-Teil:
Code:
public function view($slug)
{
$data['news_item'] = $this->news_model->get_news($slug);

if (empty($data['news_item']))
{
  show_404();
}

$data['title'] = $data['news_item']['title'];

$this->load->view('templates/header', $data);
$this->load->view('news/view', $data);
$this->load->view('templates/footer');
}

in den NEUEN Code-Teil:
Code:
public function view($slug)
{
$data['news'] = $this->news_model->get_news($slug);

if (empty($data['news']))
{
  show_404();
}

$data['title'] = $data['news']['title'];

$this->load->view('templates/header', $data);
$this->load->view('news/view', $data);
$this->load->view('templates/footer');
}

Dann klappt's!
Ach so, nicht vergessen: Seiten neu laden (Cache!).


Messages In This Thread
Tutorial error...?? (RESOLVED) - by El Forum - 01-23-2012, 05:03 PM
Tutorial error...?? (RESOLVED) - by El Forum - 01-23-2012, 07:41 PM
Tutorial error...?? (RESOLVED) - by El Forum - 01-24-2012, 09:56 AM
Tutorial error...?? (RESOLVED) - by El Forum - 01-24-2012, 05:26 PM
Tutorial error...?? (RESOLVED) - by El Forum - 01-24-2012, 10:14 PM
Tutorial error...?? (RESOLVED) - by El Forum - 01-25-2012, 02:02 AM
Tutorial error...?? (RESOLVED) - by El Forum - 01-25-2012, 02:03 AM
Tutorial error...?? (RESOLVED) - by El Forum - 01-30-2012, 08:04 PM
Tutorial error...?? (RESOLVED) - by El Forum - 01-31-2012, 01:20 PM
Tutorial error...?? (RESOLVED) - by El Forum - 02-09-2012, 04:57 AM
Tutorial error...?? (RESOLVED) - by El Forum - 02-09-2012, 10:50 AM
Tutorial error...?? (RESOLVED) - by El Forum - 02-12-2012, 02:44 PM
Tutorial error...?? (RESOLVED) - by El Forum - 02-12-2012, 07:08 PM
Tutorial error...?? (RESOLVED) - by El Forum - 02-12-2012, 08:41 PM
Tutorial error...?? (RESOLVED) - by El Forum - 02-16-2012, 01:07 PM
Tutorial error...?? (RESOLVED) - by El Forum - 02-16-2012, 03:25 PM
Tutorial error...?? (RESOLVED) - by El Forum - 03-04-2012, 09:42 PM
Tutorial error...?? (RESOLVED) - by El Forum - 07-18-2012, 09:13 AM
Tutorial error...?? (RESOLVED) - by El Forum - 08-22-2012, 03:18 AM
Tutorial error...?? (RESOLVED) - by El Forum - 08-22-2012, 03:24 AM
Tutorial error...?? (RESOLVED) - by El Forum - 10-16-2012, 01:28 PM
Tutorial error...?? (RESOLVED) - by El Forum - 02-03-2013, 02:25 AM
Tutorial error...?? (RESOLVED) - by El Forum - 02-04-2013, 11:35 AM
Tutorial error...?? (RESOLVED) - by El Forum - 08-26-2014, 08:20 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.