• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What $data[] stands for

#1
Hi,

I'm trying to learn more advanced PHP with Code Igniter and i'm starting from the Tutorial in Docs.

There in the News model i have:


Code:
$data['news'] = $this->news_model->get_news();


And in the view i have a foreach:


Code:
<?php foreach ($news as $news_item): ?>


Can i assume that $data['news'] is the same as $news?
Reply

#2
Correct ... see https://www.codeigniter.com/user_guide/g...o-the-view
Reply

#3
Thank you!
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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